diff --git a/app/Http/Controllers/Admin/AboutUsController.php b/app/Http/Controllers/Admin/AboutUsController.php index 3f20c7b..61875ac 100644 --- a/app/Http/Controllers/Admin/AboutUsController.php +++ b/app/Http/Controllers/Admin/AboutUsController.php @@ -58,6 +58,7 @@ class AboutUsController extends Controller 'description' => 'required', + 'sub_description' => 'required', 'image' => 'required|file|mimes:jpeg,png,jpg', 'keyword' => 'required' ]); @@ -67,7 +68,10 @@ class AboutUsController extends Controller $setting->description = strip_tags(\request('description')); $setting->sub_description = strip_tags(\request('sub_description')); $setting->status = \request('status'); + $setting->title = \request('title'); + $setting->bottom_title = \request('bottom_title'); $setting->keyword = \request('keyword'); + $setting->point_title = strip_tags(\request('point_title')); $setting->seo_title = \request('seo_title'); $setting->meta_keyword = strip_tags(\request('meta_keyword')); $setting->seo_description = strip_tags(\request('seo_description')); @@ -155,6 +159,8 @@ class AboutUsController extends Controller $setting->description = strip_tags(\request('description')); $setting->sub_description = strip_tags(\request('sub_description')); $setting->status = \request('status'); + $setting->title = \request('title'); + $setting->bottom_title = \request('bottom_title'); $setting->keyword = \request('keyword'); $setting->seo_title = \request('seo_title'); $setting->meta_keyword = strip_tags(\request('meta_keyword')); diff --git a/app/Http/Controllers/Admin/VisaServiceController.php b/app/Http/Controllers/Admin/VisaServiceController.php new file mode 100644 index 0000000..557ad36 --- /dev/null +++ b/app/Http/Controllers/Admin/VisaServiceController.php @@ -0,0 +1,241 @@ +where('name','like','%'.$key.'%'); + } + if(\request('status')){ + $key = \request('status'); + $services = $services->where('status',$key); + } + $services = $services->paginate(config('custom.per_page')); + return view($this->view.'index',compact('services')); + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create() + { + return view($this->view.'create'); + } + + /** + * Store a newly created resource in storage. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function store(Request $request) + { + + $this->validate(\request(),[ + 'name' => 'required', + 'seo_title' => 'required', + 'short_description' => 'required', + 'keywords'=>'required', + 'icon' => 'file|mimes:jpeg,png,jpg,svg,' + ]); + $service = new VisaService(); + $service->name = \request('name'); + // $service->image = \request('image'); + // $service->image_title = \request('image_title'); + // $service->top_description = \request('top_description'); + // $service->image_description = \request('image_description'); + // $service->bottom_description = \request('bottom_description'); + $service->seo_description = strip_tags(\request('seo_description')); + $service->seo_title = \request('seo_title'); + $service->keywords = \request('keywords'); + // $service->icon = \request('icon'); + $service->meta_keywords = strip_tags(\request('meta_keywords')); + $service->short_description = strip_tags(\request('short_description')); + // $service->point_title = \request('point_title'); + // $service->description_title = \request('description_title'); + $service->status = \request('status'); + $service->order_by = \request('order_by'); + // $service->image_alt = \request('image_alt'); + $service->slug = Setting::create_slug(\request('seo_title')); + + + if($request->hasFile('icon')){ + $extension = \request()->file('icon')->getClientOriginalExtension(); + $image_folder_type = array_search('visa_service',config('custom.image_folders')); //for image saved in folder + + $count = rand(100,999); + + $out_put_path = User::save_image(\request('icon'),$extension,$count,$image_folder_type); + is_array($out_put_path) ? $service->icon = $out_put_path[0] : $service->icon = $out_put_path; + } + + + if($service->save()){ + // $points = $request->points; + // foreach($points as $point){ + // $service_point = new ServicePoint(); + // $service_point->service_id = $service->id; + // $service_point->point = $point; + // $service_point->save(); + // } + Session::flash('success','Service has been created!'); + return redirect($this->redirect); + + } + + } + + /** + * Display the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function show($id) + { + $service = new VisaService(); + + + $service = $service->findorfail($id); + + + return view($this->view . 'show', compact('service')); + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function edit($id) + { + $service = new VisaService(); + + + $service = $service->findorfail($id); + + + return view($this->view . 'edit', compact('service')); + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param int $id + * @return \Illuminate\Http\Response + */ + public function update(Request $request, $id) + { + $this->validate(\request(),[ + + 'name' => 'required', + 'short_description' => 'required', + 'seo_title' => 'required', + 'keywords'=>'required', + + ]); + $service = new VisaService(); + $service = $service->findorfail($id); + $service->name = \request('name'); + $service->short_description = \request('short_description'); + $service->seo_description = \request('seo_description'); + $service->seo_title = \request('seo_title'); + $service->keywords = \request('keywords'); + + $service->meta_keywords = \request('meta_keywords'); + $service->status = \request('status'); + $service->order_by = \request('order_by'); + $service->slug = Setting::create_slug(\request('seo_title')); + + if($request->hasFile('icon')){ + + $extension = \request()->file('icon')->getClientOriginalExtension(); + + $image_folder_type = array_search('visa_service',config('custom.image_folders')); //for image saved in folder + $count = rand(100,999); + $out_put_path = User::save_image(\request('icon'),$extension,$count,$image_folder_type); + + + if (is_file(public_path().'/'.$service->icon) && file_exists(public_path().'/'.$service->icon)){ + unlink(public_path().'/'.$service->icon); + } + is_array($out_put_path) ? $service->icon = $out_put_path[0] : $service->icon = $out_put_path; + + + } + if($service->update()){ + Session::flash('success','Visa Service has been successfully updated!'); + return redirect($this->redirect); + // $service_point = $service->service_point(); + // $service_point->delete(); + // $points = $request->points; + // foreach($points as $point){ + // $service_point = new ServicePoint(); + // $service_point->service_id = $service->id; + // $service_point->point = $point; + // $service_point->save(); + + + + + } + + + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function delete($id) + { + $setting=VisaService::findorfail($id); + if (is_file(public_path().'/'.$setting->icon) && file_exists(public_path().'/'.$setting->icon)){ + unlink(public_path().'/'.$setting->icon); + } + $setting->delete(); + Session::flash('success','Service has been sucessfully deleted!'); + return redirect($this->redirect); + //dd("here"); + } + + + public function service_point($service_point_id){ + if(Auth::user()){ + $setting = VisaServicePoint::findorfail($service_point_id); + $setting->delete(); + return response()->json(['service_point_id' => $service_point_id]); + } + + } +} diff --git a/app/Http/Controllers/Admin/VisaServiceSectionController.php b/app/Http/Controllers/Admin/VisaServiceSectionController.php new file mode 100644 index 0000000..c93b748 --- /dev/null +++ b/app/Http/Controllers/Admin/VisaServiceSectionController.php @@ -0,0 +1,281 @@ +name; + $service_section = VisaServiceSection::where('visa_service_id',$id); + + + // if(\request('name')){ + // $key = \request('name'); + // $services = $services->where('name','like','%'.$key.'%'); + // } + // if(\request('status')){ + // $key = \request('status'); + // $services = $services->where('status',$key); + // } + $service_sections = $service_section->paginate(config('custom.per_page')); + return view($this->view.'index',compact('service_sections','service_name','id')); + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create($id) + { + $service_name = VisaService::findorfail($id)->name; + return view($this->view.'create',compact('service_name','id')); + } + + /** + * Store a newly created resource in storage. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function store(Request $request,$id) + { + + + $this->validate(\request(),[ + + // 'title' => 'required', + 'status' => 'required', + 'order_by' => 'required' + + ]); + $service_section = new VisaServiceSection(); + + $service_section->right_title = \request('right_title'); + $service_section->right_sub_title = \request('right_sub_title'); + $service_section->left_title = \request('left_title'); + $service_section->left_sub_title = \request('left_sub_title'); + $service_section->top_description = strip_tags(\request('top_description')); + $service_section->left_description = strip_tags(\request('left_description')); + $service_section->point_title = strip_tags(\request('point_title')); + $service_section->visa_length = strip_tags(\request('visa_length')); + + $service_section->visa_service_id = $id; + $service_section->status = \request('status'); + $service_section->order_by = \request('order_by'); + // $service->image_alt = \request('image_alt'); + // $service->slug = Setting::create_slug(\request('seo_title')); + + + if($request->hasFile('image')){ + $extension = \request()->file('image')->getClientOriginalExtension(); + $image_folder_type = array_search('visa_service',config('custom.image_folders')); //for image saved in folder + // dd($image_folder_type); + $count = rand(100,999); + $out_put_path = User::save_image(\request('image'),$extension,$count,$image_folder_type); + $image_path = $out_put_path[0]; + $service_section->image = $image_path; + } + + + if($service_section->save()){ + $points = $request->points; + // $point_descriptions = $request->point_descriptions ?? []; + // $icons = $request->icons ?? []; + + if($points[0] != null){ + + foreach($points as $key => $point){ + + $service_section_point = new VisaServiceSectionPoint(); + + $service_section_point->visa_service_section_id = $service_section->id; + + $service_section_point->point = $point; + $service_section_point->save(); + } + } + Session::flash('success','Visa Service Section has been created!'); + return redirect('admin/visa_services/'.$id.'/sections'); + + } + + } + + /** + * Display the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function show($id,$secId) + { + + + // $service = new Service(); + // $service_section = new ServiceSection(); + $service = VisaService::findorfail($id); + + $service_section = VisaServiceSection::findorfail($secId); + + + + return view($this->view . 'show', compact('service','service_section')); + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function edit($id,$secId) + { + $service = new VisaService(); + $service_section = new VisaServiceSection(); + $service = $service->findorfail($id); + $service_section = $service_section->findorfail($secId); + + + + + return view($this->view . 'edit', compact('service','service_section')); + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param int $id + * @return \Illuminate\Http\Response + */ + public function update(Request $request, $id, $secId) + { + $this->validate(\request(),[ + 'top_description' => 'required', + 'status' => 'required', + 'order_by' => 'required' + ]); + $service_section = VisaServiceSection::findOrFail($secId); + $service_section->right_title = \request('right_title'); + $service_section->right_sub_title = \request('right_sub_title'); + $service_section->left_title = \request('left_title'); + $service_section->left_sub_title = \request('left_sub_title'); + $service_section->top_description = strip_tags(\request('top_description')); + $service_section->left_description = strip_tags(\request('left_description')); + $service_section->point_title = strip_tags(\request('point_title')); + $service_section->visa_length = strip_tags(\request('visa_length')); + + $service_section->visa_service_id = $id; + $service_section->status = \request('status'); + $service_section->order_by = \request('order_by'); + + // if($request->hasFile('image')){ + // $extension = \request()->file('image')->getClientOriginalExtension(); + // $image_folder_type = array_search('service',config('custom.image_folders')); //for image saved in folder + // $count = rand(100,999); + // $out_put_path = User::save_image(\request('image'),$extension,$count,$image_folder_type); + // $image_path = $out_put_path[0]; + // if (is_file(public_path().'/'.$service_section->image) && file_exists(public_path().'/'.$service_section->image)){ + // unlink(public_path().'/'.$service_section->image); + // } + // $service_section->image = $image_path; + // } + if($service_section->update()){ + $points = $request->points; + if($points[0] != null){ + + if($request['point_ids'] !== null){ + + foreach($request['point_ids'] as $key => $pid){ + $service_section_point = new VisaServiceSectionPoint(); + $service_section_point = $service_section_point->find($pid); + // $service_section_point = ServiceSectionPoint::find($id); + + $service_section_point->point = $points[$key]; + $service_section_point->update(); + } + }else{ + foreach($points as $key => $point){ + + $service_section_point = new VisaServiceSectionPoint(); + + $service_section_point->visa_service_section_id = $service_section->id; + + $service_section_point->point = $point; + $service_section_point->save(); + } + } + + } + // $service_point = $service_section->service_section_point(); + // $service_point->delete(); + // foreach($points as $key => $point){ + + // $service_section_point = new ServiceSectionPoint(); + // $service_section_point->service_section_id = $service_section->id; + // if(array_key_exists($key,$point_descriptions)){ + // $service_section_point->point_description = $point_descriptions[$key]; + // } + // if(array_key_exists($key,$icons)){ + // $extension = $icons[$key]->getClientOriginalExtension(); + // $image_folder_type = array_search('service',config('custom.image_folders')); //for image saved in folder + + // $count = rand(100,999); + + // $out_put_path = User::save_image($icons[$key],$extension,$count,$image_folder_type); + // is_array($out_put_path) ? $service_section_point->icon = $out_put_path[0] : $service_section_point->icon = $out_put_path; + // // $service_section_point->icon = $points_descriptions[$key]; + // } + // $service_section_point->point = $point; + // $service_section_point->update(); + // } + + Session::flash('success','Visa Service Section has been successfully updated!'); + return redirect('admin/visa_services/'.$id.'/sections'); + + } + + + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function destroy($id) + { + // + } + + public function service_point($service_point_id){ + if(Auth::user()){ + $setting = ServiceSectionPoint::findorfail($service_point_id); + $setting->delete(); + return response()->json(['service_point_id' => $service_point_id]); + } + + } +} diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index dc439c1..bf53c3d 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -326,5 +326,7 @@ class HomeController extends Controller $news_and_updates = NewsAndUpdate::where('status',1)->get(); return view('news',compact('news_and_updates')); } + + } diff --git a/app/Http/Controllers/ServiceController.php b/app/Http/Controllers/ServiceController.php index 1b5c1f3..6ba4154 100644 --- a/app/Http/Controllers/ServiceController.php +++ b/app/Http/Controllers/ServiceController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers; use App\Models\Service; use App\Models\Accomodation; +use App\Models\VisaService; use Illuminate\Http\Request; class ServiceController extends Controller @@ -12,7 +13,21 @@ class ServiceController extends Controller $service = Service::where(['slug' => $slug,'status' => 1])->orderby('order_by','asc')->first(); $services = Service::where('status',1)->get(); // $accomodations = Accomodation::where('status',1)->get(); - + return view('service_view',compact('service','services')); } + + public function list(){ + $services = Service::where('status',1)->get(); + $visa_services = VisaService::where('status',1)->get(); + return view('services',compact('services','visa_services')); + } + + public function single_visa_service($slug){ + $service = VisaService::where(['slug' => $slug,'status' => 1])->orderby('order_by','asc')->first(); + $services = VisaService::where('status',1)->get(); + // $accomodations = Accomodation::where('status',1)->get(); + + return view('service_detail',compact('service','services')); + } } diff --git a/app/Models/User.php b/app/Models/User.php index 924d141..d3a60c9 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -156,6 +156,12 @@ class User extends Authenticatable } return $directory = 'images/partner/' . $year . '/' . $month . '/' . $day . '/'; } + if(config('custom.image_folders')[$image_folder_type] == 'visa_service') { + if (!is_dir(public_path() . '/images/visa_service/' . $year . '/' . $month . '/' . $day)) { + mkdir(public_path() . '/images/visa_service/' . $year . '/' . $month . '/' . $day, 0755, true); + } + return $directory = 'images/visa_service/' . $year . '/' . $month . '/' . $day . '/'; + } } diff --git a/app/Models/VisaService.php b/app/Models/VisaService.php index 75d8fec..9be4ce8 100644 --- a/app/Models/VisaService.php +++ b/app/Models/VisaService.php @@ -8,4 +8,8 @@ use Illuminate\Database\Eloquent\Model; class VisaService extends Model { use HasFactory; + + public function visa_service_sections(){ + return $this->hasMany(VisaServiceSection::class); + } } diff --git a/app/Models/VisaServiceSection.php b/app/Models/VisaServiceSection.php new file mode 100644 index 0000000..5eeaf3f --- /dev/null +++ b/app/Models/VisaServiceSection.php @@ -0,0 +1,18 @@ +belongsTo(VisaService::class); + } + public function visa_service_section_point(){ + return $this->hasMany(VisaServiceSectionPoint::class); + } +} diff --git a/app/Models/VisaServiceSectionPoint.php b/app/Models/VisaServiceSectionPoint.php new file mode 100644 index 0000000..777595e --- /dev/null +++ b/app/Models/VisaServiceSectionPoint.php @@ -0,0 +1,16 @@ +belongsTo(VisaServiceSection::class); + } +} diff --git a/config/custom.php b/config/custom.php index 07db205..af9d47c 100644 --- a/config/custom.php +++ b/config/custom.php @@ -48,7 +48,7 @@ return [ '7'=>'gallery', '8'=>'ndis_plan', '9' => 'testimonial', - '10' => 'accomodation', + '10' => 'visa_service', '11'=>'applicant', '12'=>'partner' diff --git a/database/migrations/2022_11_22_050244_add_point_title_to_abouts_us.php b/database/migrations/2022_11_22_050244_add_point_title_to_abouts_us.php new file mode 100644 index 0000000..a9a8cd7 --- /dev/null +++ b/database/migrations/2022_11_22_050244_add_point_title_to_abouts_us.php @@ -0,0 +1,33 @@ +string('point_title')->nullable(); + $table->string('bottom_title')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('about_us', function (Blueprint $table) { + // + }); + } +}; diff --git a/database/migrations/2022_12_13_035944_create_visa_service_sections_table.php b/database/migrations/2022_12_13_035944_create_visa_service_sections_table.php new file mode 100644 index 0000000..10f5fcd --- /dev/null +++ b/database/migrations/2022_12_13_035944_create_visa_service_sections_table.php @@ -0,0 +1,45 @@ +id(); + $table->bigInteger('visa_service_id')->unsigned(); + $table->foreign('visa_service_id')->references('id')->on('visa_services')->onDelete('cascade'); + $table->longText('top_description')->nullable(); + $table->string('image')->nullable(); + $table->string('left_title'); + $table->string('left_sub_title'); + $table->longText('left_description'); + $table->string('right_title')->nullable(); + $table->string('right_sub_title')->nullable(); + // $table->longText('sub_description')->nullable(); + $table->longText('point_title')->nullable(); + $table->string('visa_length')->nullable(); + $table->enum('status',[1,2]); + $table->string('order_by'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('visa_service_sections'); + } +}; diff --git a/database/migrations/2022_12_13_043238_create_visa_service_section_points_table.php b/database/migrations/2022_12_13_043238_create_visa_service_section_points_table.php new file mode 100644 index 0000000..6ff25f1 --- /dev/null +++ b/database/migrations/2022_12_13_043238_create_visa_service_section_points_table.php @@ -0,0 +1,34 @@ +id(); + $table->bigInteger('visa_service_section_id')->unsigned(); + $table->foreign('visa_service_section_id')->references('id')->on('visa_service_sections')->onDelete('cascade'); + $table->text('point'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('visa_service_section_points'); + } +}; diff --git a/public/cd20e81c0285e201b4badb6adb9db934.jpeg b/public/cd20e81c0285e201b4badb6adb9db934.jpeg new file mode 100644 index 0000000..7263a3a Binary files /dev/null and b/public/cd20e81c0285e201b4badb6adb9db934.jpeg differ diff --git a/public/images/visa_service/2022/12/13/a7cb5c685493b0351d53a1da0e34dc77.svg b/public/images/visa_service/2022/12/13/a7cb5c685493b0351d53a1da0e34dc77.svg new file mode 100644 index 0000000..0b4892a --- /dev/null +++ b/public/images/visa_service/2022/12/13/a7cb5c685493b0351d53a1da0e34dc77.svg @@ -0,0 +1,10 @@ + diff --git a/resources/views/about.blade.php b/resources/views/about.blade.php index a2be4b1..c27e3a0 100644 --- a/resources/views/about.blade.php +++ b/resources/views/about.blade.php @@ -20,17 +20,15 @@
APLUS AGENCY is a team of registered migration agents with over 60 years of collective experience managing migration applications for both employers and individuals. - Our background is specialised industry migration services in Hospitality. In the ten years, we have been processing these applications we have worked with many other industries and visa categories. It was a natural step to broaden Edupi’s industry base to assist the many clients with their wide and varied visa needs. +
{{$about->first()->description}}
- With the migration landscape changing in Australia due to Covid-19, it’s hard for both individuals and employers to know where they stand – having up to date advice and vigorous representation is essential for a successful visa application.
- Our expertise and streamlined migration process mean that employers and individuals will be informed and up-to-date on the status of their application. We’ll ensure, your application, from the initial consultation, has the best chance of approval, and throughout the process, support you every step of the way.
+ {{$about->first()->sub_description}}
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
+{{$about->first()->point_title}}
Work closely with members having many years of experience will help you have a chance to develop yourself.
+{{$point->point}}
+ Visa Services +
+ +- Visa Service -
- -S.N. | +Service Name | +Slug | +Icon | +Seo Title | +Order By | +Status | +Action | +
---|---|---|---|---|---|---|---|
{{$loop->iteration}} | +{{$service->name}} | +{{$service->slug}} | ++ + + + | +{{$service->seo_title}} | +{{$service->order_by}} | + +{{config('custom.status')[$service->status]}} | + + ++ + + + + + + + + | +
S.N. | +Service Name | + +Image | +Description | +Order By | + + +Status | +Action | +
---|---|---|---|---|---|---|
{{$loop->iteration}} | +{{$section->visa_service->name}} | + ++ @if($section->image != null) + + + + @else + Image not available + @endif + | +{{$section->top_description}} | +{{$section->order_by}} | + +{{config('custom.status')[$section->status]}} | ++ + + View + + + + + Edit + + + | +