Linux localhost 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
Apache/2.4.41 (Ubuntu)
: 23.92.16.63 | : 104.23.187.75
Cant Read [ /etc/named.conf ]
8.1.5
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
realestate /
source /
app /
Http /
Controllers /
[ HOME SHELL ]
Name
Size
Permission
Action
Admin
[ DIR ]
drwxr-xr-x
ApplicantController.php
32.25
KB
-rwxr-xr-x
Controller.php
299
B
-rwxr-xr-x
DirectoryController.php
10.75
KB
-rwxr-xr-x
LandlordController.php
15.28
KB
-rwxr-xr-x
MainDashboardController.php
251
B
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : ApplicantController.php
<?php namespace App\Http\Controllers; use App\Enums\ApplicantPhase; use App\Models\Applicant; use App\Models\ApplicantFile; use App\Models\ApplicantPreset; use App\Models\ApplicantUserDetail; use App\Models\Area; use App\Models\Branch; use App\Models\BuyType; use App\Models\Category; use App\Models\Country; use App\Models\Directory; use App\Models\Label; use App\Models\LettingsPW; use App\Models\OccupierType; use App\Models\PostalCode; use App\Models\PropertyType; use App\Models\Source; use App\Models\SpecialFeature; use App\Models\User; use Illuminate\Http\Request; use Spatie\Permission\Models\Permission; use Spatie\Permission\Models\Role; class ApplicantController extends Controller { public function __construct() { $this->middleware('permission:view_applicants', ['only' => ['index']]); $this->middleware('permission:create_applicants', ['only' => ['create', 'store']]); $this->middleware('permission:edit_applicants', ['only' => ['edit', 'update']]); $this->middleware('permission:delete_applicants', ['only' => ['destroy']]); } public function index(Request $request) { $title = 'Applicant'; $country = Country::orderBy('country_name', 'asc')->get(); $categories = Category::where('type','1')->get(); $labels = Label::all(); $areas = Area::all(); $negotiators = User::all(); $postalCodes = PostalCode::orderBy('postal_code')->pluck('postal_code'); $branches = Branch::orderBy('branch')->get(); $sources = Source::orderBy('name')->get(); $buyerTypes = BuyType::all(); $specialFeatures = SpecialFeature::all(); $propertyTypes = PropertyType::all(); $presets = ApplicantPreset::all(['id', 'name', 'fields']); if ($request->ajax()) { $applicants = $this->applyApplicantFilters($request); return view('front.applicant.list', compact('country', 'applicants', 'title', 'categories','labels','areas','postalCodes','negotiators','branches','sources','buyerTypes','specialFeatures','propertyTypes','presets'))->render(); } $applicants = Applicant::with('user', 'label')->get(); return view('front.applicant.list', compact('country', 'applicants', 'title', 'categories','labels','areas','postalCodes','negotiators','branches','sources','buyerTypes','specialFeatures','propertyTypes','presets')); } private function applyApplicantFilters(Request $request) { $query = Applicant::with('user'); // Filter by category if ($request->filled('category_id')) { $categoryId = (int) $request->input('category_id'); $query->whereJsonContains('category_ids', $categoryId); } if ($request->filled('status')) { $query->where('status', $request->status); } if ($request->filled('label_id')) { $query->where('label', $request->input('label_id')); } // Filter by "For" field (sale or letting) if ($request->filled('for')) { $for = $request->input('for'); if ($for === 'sale') { $query->where('property_to_sell', true); } if ($for === 'letting') { if ($request->filled('min_letting_price')) { $query->where('lettingpw_minimum', '>=', $request->input('min_letting_price')); } if ($request->filled('max_letting_price')) { $query->where('lettingpw_maximum', '<=', $request->input('max_letting_price')); } } } // ✅ Beds filter if ($request->filled('min_beds')) { $query->where('min_beds', '>=', $request->min_beds); } if ($request->filled('max_beds')) { $query->where('max_beds', '<=', $request->max_beds); } if ($request->filled('areas')) { $areas = $request->input('areas'); // array of slugs $query->whereIn('area', $areas); } if ($request->filled('postal_codes')) { $postalCodes = $request->input('postal_codes'); $query->whereHas('applicantUserDetails', function ($q) use ($postalCodes) { $q->whereIn('postcode', $postalCodes); }); } if ($request->filled('countries')) { $selectedCountries = $request->input('countries'); $query->whereHas('applicantUserDetails', function ($q) use ($selectedCountries) { $q->whereIn('country', $selectedCountries); }); } if ($request->filled('negotiator_ids')) { $query->whereIn('negotiator_id', $request->input('negotiator_ids')); } if ($request->filled('branch_id')) { $query->where('branch_id', $request->input('branch_id')); } if ($request->filled('lead_source')) { $query->where('lead_source', $request->input('lead_source')); } if ($request->filled('buyer_types')) { $query->where(function ($q) use ($request) { foreach ($request->buyer_types as $typeId) { $q->orWhereJsonContains('buyertype', (int) $typeId); } }); } if ($request->filled('lha_dwp')) { $query->where('lha_dwp', (bool) $request->input('lha_dwp')); } if ($request->filled('able_dependant_on_sale')) { $query->where('able_dependant_on_sale', $request->input('able_dependant_on_sale')); } if ($request->filled('special_feature_id')) { $featureId = (int) $request->input('special_feature_id'); $query->whereJsonContains('special_feature', $featureId); } if ($request->filled('min_baths')) { $query->where('min_baths', '>=', $request->min_baths); } if ($request->filled('max_baths')) { $query->where('max_baths', '<=', $request->max_baths); } if ($request->filled('min_parking')) { $query->whereRaw("CAST(parking AS UNSIGNED) >= ?", [(int)$request->input('min_parking')]); } if ($request->filled('property_type_id')) { $propertyTypeId = (int) $request->input('property_type_id'); $query->whereJsonContains('property_types', $propertyTypeId); } // Filter by Floor Space (sqm) if ($request->filled('min_space')) { $query->where('min_space', '>=', $request->input('min_space')); } if ($request->filled('max_space')) { $query->where('max_space', '<=', $request->input('max_space')); } // Filter by Land Size (sqm) if ($request->filled('min_land')) { $query->where('min_land', '>=', $request->input('min_land')); } if ($request->filled('max_land')) { $query->where('max_land', '<=', $request->input('max_land')); } // Filter by Notify Phone if ($request->has('notify_phone') && $request->input('notify_phone') !== '') { $query->where('notify_phone', (bool) $request->input('notify_phone')); } // Filter by Notify Email if ($request->has('notify_email') && $request->input('notify_email') !== '') { $query->where('notify_email', (bool) $request->input('notify_email')); } // Filter by Notify SMS if ($request->has('notify_sms') && $request->input('notify_sms') !== '') { $query->where('notify_sms', (bool) $request->input('notify_sms')); } // Filter by Notify Post if ($request->has('notify_post') && $request->input('notify_post') !== '') { $query->where('notify_post', (bool) $request->input('notify_post')); } // Filter by Notify Property Alerts if ($request->has('notify_property_alerts') && $request->input('notify_property_alerts') !== '') { $query->where('notify_property_alerts', (bool) $request->input('notify_property_alerts')); } // Filter by Notify General News if ($request->has('notify_general_news') && $request->input('notify_general_news') !== '') { $query->where('notify_general_news', (bool) $request->input('notify_general_news')); } // Filter by Notify Special Offers if ($request->has('notify_special_offers') && $request->input('notify_special_offers') !== '') { $query->where('notify_special_offers', (bool) $request->input('notify_special_offers')); } // Filter by bym_status if ($request->filled('bym_status')) { $status = $request->input('bym_status'); if ($status !== 'all') { $query->where('bym_status', $status); } } // Filter by created_at (From Date) if ($request->filled('from_date')) { $fromDate = $request->input('from_date'); $query->whereDate('created_at', '>=', $fromDate); } // Filter by created_at (To Date) if ($request->filled('to_date')) { $toDate = $request->input('to_date'); $query->whereDate('created_at', '<=', $toDate); } return $query->get(); } public function savePreset(Request $request) { $validated = $request->validate([ 'name' => 'required|string|max:255', 'fields' => 'required|array' ]); ApplicantPreset::create([ 'name' => $validated['name'], 'fields' => $validated['fields'], ]); return response()->json(['success' => true]); } public function loadPresets() { $presets = ApplicantPreset::all(['id', 'name', 'fields']); return response()->json($presets); } // Function to fetch users based on search query public function searchUsers(Request $request) { $query = $request->input('query'); $dcategory = $request->input('dcategory'); $searchType = $request->input('search_type'); // Get the search type // Perform search based on selected search type if ($searchType === 'company') { // Search by ID $users = Directory::join('directory_addresses', 'directory_addresses.directory_id', '=', 'directories.id') ->join('categories', 'categories.id', '=', 'directories.category') // Join with categories ->where('directories.company', 'LIKE', '%' . $query . '%') // Search by company ->where('directories.category', $dcategory) ->select('directories.*', 'directory_addresses.full_name', 'categories.name as category_name') // Get full name & category name ->get(); } else if ($searchType === 'name') { // Search by Name $users =Directory::join('directory_addresses', 'directory_addresses.directory_id', '=', 'directories.id') ->join('categories', 'categories.id', '=', 'directories.category') // Join with categories table ->where('directories.category', $dcategory) ->where('directory_addresses.full_name', 'LIKE', '%' . $query . '%') ->select('directories.*', 'directory_addresses.full_name', 'categories.name as category_name') // Get category name ->get(); } else { $users = []; // Return empty array if no valid search type } return response()->json($users); // Return the results as JSON } public function checkUsername(Request $request) { $exists = User::where('email', $request->username)->exists(); return response()->json(['exists' => $exists]); } public function create() { // Logic for creating a role $title='Applicant'; $lettingpw=LettingsPW::where('type',1)->get(); $salespw=LettingsPW::where('type',2)->get(); $occupiertype=OccupierType::where('status',1)->get(); $specialf=SpecialFeature::where('status',1)->get(); $negotiators = User::all(); $category = Category::where('type','2')->orderBy('name', 'asc')->get(); $categories = Category::where('type','1')->orderBy('name', 'asc')->get(); $country = Country::orderBy('country_name', 'asc')->get(); $buyertype=BuyType::where('status','1')->get(); $label=Label::where('status','1')->get(); $branch=Branch::all(); $user=User::all(); $areas=Area::all(); return view('front.applicant.applicant_form',compact('lettingpw','title','country','categories','occupiertype','salespw','category','buyertype','specialf','label','branch','user','areas','negotiators')); } public function getByCategories(Request $request) { $categoryIds = $request->input('category_ids'); if (!$categoryIds) { return response()->json(['message' => 'No categories selected.'], 400); } // Get Property Types that are linked to the selected categories $propertyTypes = PropertyType::whereHas('categories', function ($query) use ($categoryIds) { $query->whereIn('categories.id', $categoryIds); })->get(); // Return view or JSON response return response()->json([ 'propertyTypes' => view('admin.property_types.property_types_list', compact('propertyTypes'))->render() ]); } public function getBy_Categories(Request $request) { $categoryIds = $request->input('category_ids'); $applicantId = $request->input('id'); if (empty($categoryIds) || !is_array($categoryIds)) { return response()->json(['message' => 'No categories selected.'], 400); } // Load applicant for edit context $applicant = Applicant::with('applicantUserDetails')->find($applicantId); if (!$applicant) { return response()->json(['message' => 'Applicant not found.'], 404); } // Fetch property types related to categories $propertyTypes = PropertyType::whereHas('categories', function ($query) use ($categoryIds) { $query->whereIn('categories.id', $categoryIds); })->get(); return response()->json([ 'propertyTypes' => view('admin.property_types.property_types_list_edit', compact('propertyTypes', 'applicant'))->render() ]); } public function deleteFile(Request $request, $applicantId) { $request->validate([ 'file' => 'required|string', 'id' => 'required|integer' ]); $filePath = public_path("assets/applicants/" . $request->file); if (file_exists($filePath)) { unlink($filePath); } // Delete DB record ApplicantFile::where('id', $request->id)->delete(); return response()->json([ 'success' => true, 'message' => 'File deleted successfully' ]); } public function store(Request $request) { try { \DB::beginTransaction(); $categoryIds = is_array($request->category_ids) ? $request->category_ids : []; $propertyTypes = is_array($request->property_types) ? $request->property_types : []; $specialfeature = is_array($request->special_feature) ? $request->special_feature : []; $buyertypes = is_array($request->buyertype) ? $request->buyertype : []; $boccupiertypes= is_array($request->occupiertype) ? implode(',', $request->occupiertype) : null; // Create Applicant $applicant = Applicant::create([ 'guarantor_name' => $request->guarantor_name, 'guarantor_contact'=> $request->guarantor_contact, 'guarantor_email'=> $request->guarantor_email, 'guarantor_fax'=> $request->guarantor_fax, 'guarantor_dob'=> $request->guarantor_dob, // 'lettingswpCheck'=> $request->lettingswpCheck, 'guarantor_website'=> $request->website, 'guarantor_pager'=> $request->guarantor_pager, 'guarantor_birth_place'=> $request->guarantor_birth_place, 'guarantor_nationality'=> $request->guarantor_nationality, 'guarantor_passport_no'=> $request->guarantor_passport_no, 'guarantor_gender'=> $request->guarantor_gender, 'lettingswp'=> $request->lettingswp, 'lettingpw_minimum'=> $request->lettingpw_minimum, 'lettingpw_maximum'=> $request->lettingpw_maximum, 'lettingpw_threshold'=> $request->lettingpw_threshold, 'furniture'=> $request->furniture, 'lha_dwp'=> $request->lha_dwp, 'tenancy_period'=> $request->tenancy_period, 'employment_status'=> $request->employment_status, 'employment_type'=> $request->employment_type, 'income'=> $request->income, 'income_frequency'=> $request->income_frequency, 'smoking'=> $request->smoking, 'pets'=> $request->pets, 'category_ids'=>$categoryIds, 'property_types'=>$propertyTypes, 'special_feature'=>$specialfeature, 'occupiertype'=> $boccupiertypes, 'sales_check'=> $request->sales_check, 'sales_minimum'=> $request->sales_minimum, 'sales_maximum'=> $request->sales_maximum, 'sales_threshold'=> $request->sales_threshold, 'mortgage'=> $request->mortgage, 'mortgage_status'=> $request->mortgage_status, 'lander'=> $request->lander, 'deposit_amount'=> $request->deposit_amount, 'able_dependant_on_sale'=> $request->able_dependant_on_sale, 'first_time_buyer'=> $request->first_time_buyer, 'lease_expiry_date'=> $request->lease_expiry_date, 'nothing_to_sell'=> $request->nothing_to_sell, 'investor'=> $request->investor, 'area'=> $request->area, 'user_account_type'=> $request->user_account_type, 'additional_investment'=> $request->additional_investment, 'underoffer'=> $request->underoffer, 'under_offer_price'=> $request->under_offer_price, 'chain'=> $request->chain, 'chain_note'=> $request->chain_note, 'property_to_sell'=> $request->property_to_sell, 'property_type'=> $request->property_type, 'anticipated_sale_price'=> $request->anticipated_sale_price, 'any_advice'=> $request->any_advice, 'property_to_market'=> $request->property_to_market, 'property_markeat_type'=> $request->property_markeat_type, 'how_long'=> $request->how_long, 'price_on_market'=> $request->price_on_market, 'interest'=> $request->interest, 'agent'=> $request->agent, 'contract_term'=> $request->contract_term, 'why_choose'=> $request->why_choose, 'buyertype'=> $buyertypes, // 'property_types'=> $request->property_types, 'min_beds'=> $request->min_beds, 'max_beds'=> $request->max_beds, 'min_baths'=> $request->min_baths, 'max_baths'=> $request->max_baths, 'parking'=> $request->parking, 'min_space'=> $request->min_space, 'max_space'=> $request->max_space, 'min_land'=> $request->min_land, 'max_land'=> $request->max_land, 'build_year_start'=> $request->build_year_start, 'build_year_end'=> $request->build_year_end, // 'special_feature'=> $request->special_feature, 'property_required_by'=> $request->property_required_by, 'bym_status'=> $request->bym_status, 'notify_property_alerts'=> $request->notify_property_alerts, 'notify_general_news'=> $request->notify_general_news, 'notify_special_offers'=> $request->notify_special_offers, 'notify_phone'=> $request->notify_phone, 'notify_email'=> $request->notify_email, 'notify_sms'=> $request->notify_sms, 'notify_post'=> $request->notify_post, 'solicitor'=> $request->solicitor, 'label'=> $request->label, 'status'=> $request->status, 'branch_id'=> $request->branch_id, 'negotiator_id'=> $request->negotiator_id, 'assigned_to'=> $request->assigned_to, 'lead_source'=> $request->lead_source, 'comments'=> $request->comments, 'other_info'=> $request->other_info, 'username'=> $request->username, 'password'=> $request->password, ]); // Create Applicant User Detail foreach ($request->last_name as $i=> $detail) { $applicantUserDetail= ApplicantUserDetail::create([ 'applicant_id' => $applicant->id, 'last_name' => $detail ?? null, 'first_name' => $request['first_name'][$i] ?? null, 'title' => $request['title'][$i] ?? null, 'salutation' => $request['salutation'][$i] ?? null, 'postcode' => $request['postcode'][$i] ?? null, 'addresslineone' => $request['addresslineone'][$i] ?? null, 'addresslinetwo' => $request['addresslinetwo'][$i] ?? null, 'town' => $request['town'][$i] ?? null, 'county' => $request['county'][$i] ?? null, 'country' => $request['country'][$i] ?? null, 'phonehome' => $request['phonehome'][$i] ?? null, 'phonework' => $request['phonework'][$i] ?? null, 'phonemobile' => $request['phonemobile'][$i] ?? null, 'fax' => $request['fax'][$i] ?? null, 'email' => $request['email'][$i] ?? null, 'company' => $request['company'] ?? null, ]); } // Save Applicant Files if ($request->hasFile('files_list')) { foreach ($request->file('files_list') as $file) { $fileName = time() . '_' . $file->getClientOriginalName(); $filePath = 'assets/applicants/'; // Move file to public assets directory // $file->move(public_path('assets/applicants/'), $fileName); $file->move($filePath, $fileName); // Save file in database ApplicantFile::create([ 'applicant_id' => $applicant->id, 'file_name' => $fileName, ]); } } \DB::commit(); // Commit transaction return redirect()->route('applicant')->with('success', 'Applicant, user details, and files created successfully!'); } catch (\Exception $e) { \DB::rollBack(); // Rollback transaction on error return redirect()->back()->with('error', 'Error saving applicant data: ' . $e->getMessage()); } } public function update(Request $request, $id) { try { \DB::beginTransaction(); // Start transaction $applicant = Applicant::findOrFail($id); // Fetch the applicant // Convert arrays to comma-separated strings $categoryIds = is_array($request->category_ids) ? $request->category_ids : []; $propertyTypes = is_array($request->property_types) ? $request->property_types : []; $specialFeature = is_array($request->special_feature) ? $request->special_feature : []; $buyerTypes = is_array($request->buyertype) ? $request->buyertype : []; $occupierTypes = is_array($request->occupiertype) ? implode(',', $request->occupiertype) : null; // Update Applicant $applicant->update([ 'guarantor_name' => $request->guarantor_name, 'guarantor_contact' => $request->guarantor_contact, 'guarantor_email' => $request->guarantor_email, 'guarantor_fax' => $request->guarantor_fax, 'guarantor_dob' => $request->guarantor_dob, 'guarantor_website' => $request->website, 'guarantor_pager' => $request->guarantor_pager, 'guarantor_birth_place' => $request->guarantor_birth_place, 'guarantor_nationality' => $request->guarantor_nationality, 'guarantor_passport_no' => $request->guarantor_passport_no, 'guarantor_gender' => $request->guarantor_gender, 'lettingswp' => $request->lettingswp, 'lettingpw_minimum' => $request->lettingpw_minimum, 'lettingpw_maximum' => $request->lettingpw_maximum, 'lettingpw_threshold' => $request->lettingpw_threshold, 'furniture' => $request->furniture, 'phase' => $request->phase, 'lha_dwp' => $request->lha_dwp, 'tenancy_period' => $request->tenancy_period, 'employment_status' => $request->employment_status, 'employment_type' => $request->employment_type, 'income' => $request->income, 'income_frequency' => $request->income_frequency, 'smoking' => $request->smoking, 'pets' => $request->pets, 'category_ids' => $categoryIds, 'property_types' => $propertyTypes, 'special_feature' => $specialFeature, 'occupiertype' => $occupierTypes, 'sales_check' => $request->sales_check, 'sales_minimum' => $request->sales_minimum, 'sales_maximum' => $request->sales_maximum, 'sales_threshold' => $request->sales_threshold, 'mortgage' => $request->mortgage, 'mortgage_status' => $request->mortgage_status, 'lander' => $request->lander, 'deposit_amount' => $request->deposit_amount, 'able_dependant_on_sale' => $request->able_dependant_on_sale, 'first_time_buyer' => $request->first_time_buyer, 'lease_expiry_date' => $request->lease_expiry_date, 'nothing_to_sell' => $request->nothing_to_sell, 'investor' => $request->investor, 'area' => $request->area, 'user_account_type' => $request->user_account_type, 'additional_investment' => $request->additional_investment, 'underoffer' => $request->underoffer, 'under_offer_price' => $request->under_offer_price, 'chain' => $request->chain, 'chain_note' => $request->chain_note, 'property_to_sell' => $request->property_to_sell, 'property_type' => $request->property_type, 'anticipated_sale_price' => $request->anticipated_sale_price, 'any_advice' => $request->any_advice, 'property_to_market' => $request->property_to_market, 'property_markeat_type' => $request->property_markeat_type, 'how_long' => $request->how_long, 'price_on_market' => $request->price_on_market, 'interest' => $request->interest, 'agent' => $request->agent, 'contract_term' => $request->contract_term, 'why_choose' => $request->why_choose, 'buyertype' => $buyerTypes, 'min_beds' => $request->min_beds, 'max_beds' => $request->max_beds, 'min_baths' => $request->min_baths, 'max_baths' => $request->max_baths, 'parking' => $request->parking, 'min_space' => $request->min_space, 'max_space' => $request->max_space, 'min_land' => $request->min_land, 'max_land' => $request->max_land, 'build_year_start' => $request->build_year_start, 'build_year_end' => $request->build_year_end, 'property_required_by' => $request->property_required_by, 'bym_status' => $request->bym_status, 'notify_property_alerts' => $request->notify_property_alerts, 'notify_general_news' => $request->notify_general_news, 'notify_special_offers' => $request->notify_special_offers, 'notify_phone' => $request->notify_phone, 'notify_email' => $request->notify_email, 'notify_sms' => $request->notify_sms, 'notify_post' => $request->notify_post, 'solicitor' => $request->solicitor, 'label' => $request->label, 'status' => $request->status, 'branch_id' => $request->branch_id, 'negotiator_id' => $request->negotiator_id, 'assigned_to' => $request->assigned_to, 'lead_source' => $request->lead_source, 'comments' => $request->comments, 'other_info' => $request->other_info, 'username' => $request->username, ]); // Update password only if provided if ($request->filled('password')) { $applicant->update(['password' => bcrypt($request->password)]); } // Update Applicant User Details foreach ($request->last_name as $i => $detail) { ApplicantUserDetail::updateOrCreate( ['applicant_id' => $applicant->id, 'last_name' => $detail], [ 'first_name' => $request['first_name'][$i] ?? null, 'title' => $request['title'][$i] ?? null, 'postcode' => $request['postcode'][$i] ?? null, 'email' => $request['email'][$i] ?? null, 'company' => $request['company'] ?? null, ] ); } // Handle File Uploads if ($request->hasFile('files_list')) { foreach ($request->file('files_list') as $file) { $fileName = time() . '_' . $file->getClientOriginalName(); $filePath = 'assets/applicants/'; $file->move($filePath, $fileName); // Save file in database ApplicantFile::create([ 'applicant_id' => $applicant->id, 'file_name' => $fileName, ]); } } \DB::commit(); // Commit transaction return redirect()->route('applicant')->with('success', 'Applicant updated successfully!'); } catch (\Exception $e) { \DB::rollBack(); // Rollback transaction on error // echo $e->getMessage(); return redirect()->back()->with('error', 'Error updating applicant: ' . $e->getMessage()); } } public function edit($id) { $title='Applicant'; $lettingpw=LettingsPW::where('type',1)->get(); $salespw=LettingsPW::where('type',2)->get(); $occupiertype=OccupierType::where('status',1)->get(); $specialf=SpecialFeature::where('status',1)->get(); $category = Category::where('type','2')->orderBy('name', 'asc')->get(); $categories = Category::where('type','1')->orderBy('name', 'asc')->get(); $country = Country::orderBy('country_name', 'asc')->get(); $buyertype=BuyType::where('status','1')->get(); $label=Label::where('status','1')->get(); $branch=Branch::all(); $user=User::all(); $negotiators=User::all(); $areas=Area::all(); $sources=Source::all(); $applicant = Applicant::with('applicantUserDetails','applicantFiles')->where('id',$id)->first(); return view('front.applicant.edit',compact('applicant','title','lettingpw','country','categories','occupiertype','salespw','category','buyertype','specialf','label','branch','user','areas','sources','negotiators')); } public function destroy($id) { // Logic for deleting a role } }
Close