diff --git a/app/Http/Controllers/Admin/VisaServiceController.php b/app/Http/Controllers/Admin/VisaServiceController.php index 8b37653..9834e78 100644 --- a/app/Http/Controllers/Admin/VisaServiceController.php +++ b/app/Http/Controllers/Admin/VisaServiceController.php @@ -62,6 +62,7 @@ class VisaServiceController extends Controller 'seo_title' => 'required', 'short_description' => 'required', 'keywords'=>'required', + 'image'=>'required|mimes:jpeg,png,jpg,svg', 'icon' => 'file|mimes:jpeg,png,jpg,svg,' ]); $service = new VisaService(); @@ -168,6 +169,7 @@ class VisaServiceController extends Controller 'short_description' => 'required', 'seo_title' => 'required', 'keywords'=>'required', + 'image'=>'required|mimes:jpeg,png,jpg,svg', ]); $service = new VisaService(); diff --git a/app/Http/Controllers/Admin/VisaServiceSectionController.php b/app/Http/Controllers/Admin/VisaServiceSectionController.php index c93b748..84aa620 100644 --- a/app/Http/Controllers/Admin/VisaServiceSectionController.php +++ b/app/Http/Controllers/Admin/VisaServiceSectionController.php @@ -71,15 +71,10 @@ class VisaServiceSectionController extends Controller ]); $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->title = \request('title'); + $service_section->sub_title = \request('sub_title'); + $service_section->description = (\request('description')); + $service_section->sub_description = (\request('sub_description')); $service_section->visa_service_id = $id; $service_section->status = \request('status'); $service_section->order_by = \request('order_by'); @@ -99,22 +94,22 @@ class VisaServiceSectionController extends Controller if($service_section->save()){ - $points = $request->points; + // $points = $request->points; // $point_descriptions = $request->point_descriptions ?? []; // $icons = $request->icons ?? []; - if($points[0] != null){ + // if($points[0] != null){ - foreach($points as $key => $point){ + // foreach($points as $key => $point){ - $service_section_point = new VisaServiceSectionPoint(); + // $service_section_point = new VisaServiceSectionPoint(); - $service_section_point->visa_service_section_id = $service_section->id; + // $service_section_point->visa_service_section_id = $service_section->id; - $service_section_point->point = $point; - $service_section_point->save(); - } - } + // $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'); @@ -177,15 +172,10 @@ class VisaServiceSectionController extends Controller '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->title = \request('title'); + $service_section->sub_title = \request('sub_title'); + $service_section->description = (\request('description')); + $service_section->sub_description = (\request('sub_description')); $service_section->visa_service_id = $id; $service_section->status = \request('status'); $service_section->order_by = \request('order_by'); @@ -202,32 +192,32 @@ class VisaServiceSectionController extends Controller // $service_section->image = $image_path; // } if($service_section->update()){ - $points = $request->points; - if($points[0] != null){ + // $points = $request->points; + // if($points[0] != null){ - if($request['point_ids'] !== 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); + // 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->point = $points[$key]; + // $service_section_point->update(); + // } + // }else{ + // foreach($points as $key => $point){ - $service_section_point = new VisaServiceSectionPoint(); + // $service_section_point = new VisaServiceSectionPoint(); - $service_section_point->visa_service_section_id = $service_section->id; + // $service_section_point->visa_service_section_id = $service_section->id; - $service_section_point->point = $point; - $service_section_point->save(); - } - } + // $service_section_point->point = $point; + // $service_section_point->save(); + // } + // } - } + // } // $service_point = $service_section->service_section_point(); // $service_point->delete(); // foreach($points as $key => $point){ @@ -271,6 +261,7 @@ class VisaServiceSectionController extends Controller } public function service_point($service_point_id){ + if(Auth::user()){ $setting = ServiceSectionPoint::findorfail($service_point_id); $setting->delete(); diff --git a/app/Http/Controllers/VisaController.php b/app/Http/Controllers/VisaController.php index 7472194..dc7b4e1 100644 --- a/app/Http/Controllers/VisaController.php +++ b/app/Http/Controllers/VisaController.php @@ -13,4 +13,10 @@ class VisaController extends Controller $visas = VisaService::where('status',1)->get(); return view('visa',compact('visas','page')); } + public function details($slug){ + $page = Page::where(['title' => 'Visa','status' => 1])->first(); + $visas = VisaService::where('status',1)->get(); + $service = VisaService::where(['slug' => $slug,'status' => 1])->orderby('order_by','asc')->first(); + return view('visa',compact('service','page','visas')); + } } diff --git a/database/migrations/2022_12_13_035944_create_visa_service_sections_table.php b/database/migrations/2022_12_13_035945_create_visa_service_sections_table.php similarity index 64% rename from database/migrations/2022_12_13_035944_create_visa_service_sections_table.php rename to database/migrations/2022_12_13_035945_create_visa_service_sections_table.php index 10f5fcd..43054e6 100644 --- a/database/migrations/2022_12_13_035944_create_visa_service_sections_table.php +++ b/database/migrations/2022_12_13_035945_create_visa_service_sections_table.php @@ -17,16 +17,11 @@ return new class extends Migration $table->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->string('title'); + $table->string('sub_title')->nullable(); + $table->longText('description'); + $table->longText('sub_description')->nullable(); $table->enum('status',[1,2]); $table->string('order_by'); $table->timestamps(); diff --git a/public/images/visa_service/2023/01/27/bc804c9c9e533c4b8a25f341ab7fcf2b.svg b/public/images/visa_service/2023/01/27/bc804c9c9e533c4b8a25f341ab7fcf2b.svg deleted file mode 100644 index 70c9bd9..0000000 --- a/public/images/visa_service/2023/01/27/bc804c9c9e533c4b8a25f341ab7fcf2b.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/public/images/visa_service/2023/02/01/18fcf4077cefa53bc1ec28c8fed463cc.png b/public/images/visa_service/2023/02/01/18fcf4077cefa53bc1ec28c8fed463cc.png new file mode 100644 index 0000000..ddc5773 Binary files /dev/null and b/public/images/visa_service/2023/02/01/18fcf4077cefa53bc1ec28c8fed463cc.png differ diff --git a/public/images/visa_service/2023/02/01/532f0d3ebffd9da0dc5139849e941b27.png b/public/images/visa_service/2023/02/01/532f0d3ebffd9da0dc5139849e941b27.png new file mode 100644 index 0000000..dc211ed Binary files /dev/null and b/public/images/visa_service/2023/02/01/532f0d3ebffd9da0dc5139849e941b27.png differ diff --git a/resources/views/admin/service_section/edit.blade.php b/resources/views/admin/service_section/edit.blade.php index fa9a84e..190ed4c 100644 --- a/resources/views/admin/service_section/edit.blade.php +++ b/resources/views/admin/service_section/edit.blade.php @@ -89,56 +89,10 @@
- @if($service_section->service_section_point) -
-
-
-
-
+ - -
- @foreach($service_section->service_section_point as $section_point) - -
-
-
-
-
- @if($section_point->icon != null) - - @endif -
- -
- @endforeach -
- -
-
-
-
- @else - - + - @endif
diff --git a/resources/views/admin/visa_service/create.blade.php b/resources/views/admin/visa_service/create.blade.php index b4fda75..074c6d1 100644 --- a/resources/views/admin/visa_service/create.blade.php +++ b/resources/views/admin/visa_service/create.blade.php @@ -77,8 +77,8 @@
- - + +
@@ -137,6 +137,9 @@ @endsection @section('script')