diff --git a/app/Http/Controllers/Admin/NewsAndUpdateController.php b/app/Http/Controllers/Admin/NewsAndUpdateController.php index 325a2bc..55abbf5 100644 --- a/app/Http/Controllers/Admin/NewsAndUpdateController.php +++ b/app/Http/Controllers/Admin/NewsAndUpdateController.php @@ -53,7 +53,8 @@ class NewsAndUpdateController extends Controller 'keyword' => 'required', 'meta-keyword' => 'nullable', 'status' => 'required', - 'image' => 'required|file|mimes:jpeg,png,jpg,pdf' + 'image' => 'required|file|mimes:jpeg,png,jpg,pdf', + 'thumbnail' => 'required', ]); if($request->hasFile('image')){ $extension = \request()->file('image')->getClientOriginalExtension(); @@ -62,14 +63,23 @@ class NewsAndUpdateController extends Controller $out_put_path = User::save_image(\request('image'),$extension,$count,$image_folder_type); $image_path1 = $out_put_path[0]; } + if($request->hasFile('thumbnail')){ + $extension = \request()->file('thumbnail')->getClientOriginalExtension(); + $image_folder_type = array_search('news_and_update',config('custom.image_folders')); //for image saved in folder + $count = rand(100,999); + $out_put_path = User::save_image(\request('thumbnail'),$extension,$count,$image_folder_type); + $thumbnail_path1 = $out_put_path[0]; + } $requestData = $request->all(); if(isset($image_path1)){ $requestData['image'] = $image_path1; } + if(isset($thumbnail_path1)){ + $requestData['thumbnail'] = $thumbnail_path1; + } $requestData['slug'] = Setting::create_slug($requestData['keyword']); - $requestData['blog_type'] =1; $setting = NewsAndUpdate::create($requestData); if(\request('point_title')){ foreach (\request('point') as $index => $value){ @@ -96,7 +106,6 @@ class NewsAndUpdateController extends Controller public function update(Request $request, $id){ -// dd(\request()->all()); $setting =NewsAndUpdate::findorfail($id); $this->validate(\request(), [ 'description' => 'required', @@ -110,7 +119,7 @@ class NewsAndUpdateController extends Controller if(\request('image')){ $this->validate(\request(),[ - 'image' => 'file|mimes:jpeg,png,jpg,pdf' + 'image' => 'file|mimes:jpeg,png,jpg' ]); if($request->hasFile('image')){ $extension = \request()->file('image')->getClientOriginalExtension(); @@ -122,6 +131,17 @@ class NewsAndUpdateController extends Controller unlink(public_path().'/'.$setting->image); } } + + } + if($request->hasFile('thumbnail')){ + $extension = \request()->file('thumbnail')->getClientOriginalExtension(); + $image_folder_type = array_search('news_and_update',config('custom.image_folders')); //for image saved in folder + $count = rand(100,999); + $out_put_path = User::save_image(\request('thumbnail'),$extension,$count,$image_folder_type); + $thumbnail_path1 = $out_put_path[0]; + if (is_file(public_path().'/'.$setting->thumbnail) && file_exists(public_path().'/'.$setting->thumbnail)){ + unlink(public_path().'/'.$setting->thumbnail); + } } @@ -130,7 +150,9 @@ class NewsAndUpdateController extends Controller if(isset($image_path1)){ $requestData['image'] = $image_path1; } - $requestData['blog_type'] =1; + if(isset($thumbnail_path1)){ + $requestData['thumbnail'] = $thumbnail_path1; + } $setting->fill($requestData); $setting->save(); if(\request('point_title') ){ diff --git a/app/Http/Controllers/Admin/VisaServiceController.php b/app/Http/Controllers/Admin/VisaServiceController.php index 5955184..8b37653 100644 --- a/app/Http/Controllers/Admin/VisaServiceController.php +++ b/app/Http/Controllers/Admin/VisaServiceController.php @@ -203,7 +203,7 @@ class VisaServiceController extends Controller $extension = \request()->file('image')->getClientOriginalExtension(); - $image_folder_type = array_search('vis_service',config('custom.image_folders')); //for image saved in folder + $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('image'),$extension,$count,$image_folder_type); diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index bf53c3d..66ba632 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -21,6 +21,7 @@ use App\Models\User; use App\Models\Partner; use PDF; use Illuminate\Support\Str; +use Illuminate\Support\Facades\Artisan; class HomeController extends Controller { diff --git a/app/Models/NewsAndUpdate.php b/app/Models/NewsAndUpdate.php index 4c9ad63..a5ab57a 100644 --- a/app/Models/NewsAndUpdate.php +++ b/app/Models/NewsAndUpdate.php @@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Model; class NewsAndUpdate extends Model { use HasFactory; - protected $fillable=['slug','point_title','blog_type','image','image_alt','description','seo_title','seo_description','middle_description','bottom_description','keyword','meta_keyword','status','publish_date','title','image_credit','author','image_caption']; + protected $fillable=['slug','point_title','blog_type','image','image_alt','description','seo_title','seo_description','middle_description','bottom_description','keyword','meta_keyword','status','publish_date','title','image_credit','author','image_caption','thumbnail']; public function news_and_update_points() { diff --git a/config/custom.php b/config/custom.php index af9d47c..20bc4d4 100644 --- a/config/custom.php +++ b/config/custom.php @@ -11,8 +11,8 @@ return [ ], 'blog_types'=>[ - '1'=>'News', - '2'=>'Notice', + '1'=>'Featured', + '2'=>'Not Featured', ], 'states' =>[ diff --git a/database/migrations/2022_12_14_071737_add_image_to_visa_services_table.php b/database/migrations/2022_12_14_071738_add_image_to_visa_services_table.php similarity index 92% rename from database/migrations/2022_12_14_071737_add_image_to_visa_services_table.php rename to database/migrations/2022_12_14_071738_add_image_to_visa_services_table.php index a05a7f6..4585df8 100644 --- a/database/migrations/2022_12_14_071737_add_image_to_visa_services_table.php +++ b/database/migrations/2022_12_14_071738_add_image_to_visa_services_table.php @@ -14,7 +14,7 @@ return new class extends Migration public function up() { Schema::table('visa_services', function (Blueprint $table) { - // + $table->string('image')->nullable(); }); } diff --git a/database/migrations/2022_12_14_093317_add_thumbnai_to_news_and_updates_table.php b/database/migrations/2022_12_14_093317_add_thumbnai_to_news_and_updates_table.php new file mode 100644 index 0000000..40d6d47 --- /dev/null +++ b/database/migrations/2022_12_14_093317_add_thumbnai_to_news_and_updates_table.php @@ -0,0 +1,32 @@ +string('thumbnail'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('news_and_updates', function (Blueprint $table) { + // + }); + } +}; diff --git a/public/frontend/.DS_Store b/public/frontend/.DS_Store new file mode 100644 index 0000000..1093100 Binary files /dev/null and b/public/frontend/.DS_Store differ diff --git a/public/images/news_and_update/2022/12/14/305b95b50e3530e978e779f5ca431a5b.jpeg b/public/images/news_and_update/2022/12/14/305b95b50e3530e978e779f5ca431a5b.jpeg new file mode 100644 index 0000000..7263a3a Binary files /dev/null and b/public/images/news_and_update/2022/12/14/305b95b50e3530e978e779f5ca431a5b.jpeg differ diff --git a/public/images/news_and_update/2022/12/14/3e151b4e1e3a3d5eb4db8d72666a65d6.jpeg b/public/images/news_and_update/2022/12/14/3e151b4e1e3a3d5eb4db8d72666a65d6.jpeg new file mode 100644 index 0000000..7263a3a Binary files /dev/null and b/public/images/news_and_update/2022/12/14/3e151b4e1e3a3d5eb4db8d72666a65d6.jpeg differ diff --git a/public/images/news_and_update/2022/12/14/4e0ce4da583b4939acaddfe7f9a3779a.jpeg b/public/images/news_and_update/2022/12/14/4e0ce4da583b4939acaddfe7f9a3779a.jpeg new file mode 100644 index 0000000..7263a3a Binary files /dev/null and b/public/images/news_and_update/2022/12/14/4e0ce4da583b4939acaddfe7f9a3779a.jpeg differ diff --git a/public/images/service/2022/12/14/f32db952dcf6def35e25c26a3eea2967.jpeg b/public/images/news_and_update/2022/12/14/765d36be8f87786e1e09049684d040f3.jpeg similarity index 100% rename from public/images/service/2022/12/14/f32db952dcf6def35e25c26a3eea2967.jpeg rename to public/images/news_and_update/2022/12/14/765d36be8f87786e1e09049684d040f3.jpeg diff --git a/public/images/news_and_update/2022/12/14/7fe9a55ac4800260b39524359cd1ecdd.jpeg b/public/images/news_and_update/2022/12/14/7fe9a55ac4800260b39524359cd1ecdd.jpeg new file mode 100644 index 0000000..686aaa8 Binary files /dev/null and b/public/images/news_and_update/2022/12/14/7fe9a55ac4800260b39524359cd1ecdd.jpeg differ diff --git a/public/images/news_and_update/2022/12/14/8cbf7018583a039c2e50f83858b791a5.jpeg b/public/images/news_and_update/2022/12/14/8cbf7018583a039c2e50f83858b791a5.jpeg new file mode 100644 index 0000000..686aaa8 Binary files /dev/null and b/public/images/news_and_update/2022/12/14/8cbf7018583a039c2e50f83858b791a5.jpeg differ diff --git a/public/images/news_and_update/2022/12/14/afb58cdba5b645f0826ee8a9e43ac702.jpeg b/public/images/news_and_update/2022/12/14/afb58cdba5b645f0826ee8a9e43ac702.jpeg new file mode 100644 index 0000000..686aaa8 Binary files /dev/null and b/public/images/news_and_update/2022/12/14/afb58cdba5b645f0826ee8a9e43ac702.jpeg differ diff --git a/public/images/news_and_update/2022/12/14/ce5572c130720f6ae2332dec9a2ab6ae.jpeg b/public/images/news_and_update/2022/12/14/ce5572c130720f6ae2332dec9a2ab6ae.jpeg new file mode 100644 index 0000000..686aaa8 Binary files /dev/null and b/public/images/news_and_update/2022/12/14/ce5572c130720f6ae2332dec9a2ab6ae.jpeg differ diff --git a/public/images/news_and_update/2022/12/14/ce706dfb910f0a8dab7ef0246792e3c1.jpeg b/public/images/news_and_update/2022/12/14/ce706dfb910f0a8dab7ef0246792e3c1.jpeg new file mode 100644 index 0000000..686aaa8 Binary files /dev/null and b/public/images/news_and_update/2022/12/14/ce706dfb910f0a8dab7ef0246792e3c1.jpeg differ diff --git a/public/images/news_and_update/2022/12/14/ecbec01b556e0614572ccb4459493715.jpeg b/public/images/news_and_update/2022/12/14/ecbec01b556e0614572ccb4459493715.jpeg new file mode 100644 index 0000000..7263a3a Binary files /dev/null and b/public/images/news_and_update/2022/12/14/ecbec01b556e0614572ccb4459493715.jpeg differ diff --git a/public/images/news_and_update/2022/12/14/fc0d4e2779a8ebfc6559a637aedddc67.jpeg b/public/images/news_and_update/2022/12/14/fc0d4e2779a8ebfc6559a637aedddc67.jpeg new file mode 100644 index 0000000..7263a3a Binary files /dev/null and b/public/images/news_and_update/2022/12/14/fc0d4e2779a8ebfc6559a637aedddc67.jpeg differ diff --git a/public/images/service/2022/12/13/d86498cb6e2a179f74828163114034b9.svg b/public/images/service/2022/12/13/d86498cb6e2a179f74828163114034b9.svg deleted file mode 100644 index 0b4892a..0000000 --- a/public/images/service/2022/12/13/d86498cb6e2a179f74828163114034b9.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/public/images/service/2022/12/14/fa40f0aeeee884422ab00d05625d7291.jpeg b/public/images/service/2022/12/14/fa40f0aeeee884422ab00d05625d7291.jpeg new file mode 100644 index 0000000..7263a3a Binary files /dev/null and b/public/images/service/2022/12/14/fa40f0aeeee884422ab00d05625d7291.jpeg differ diff --git a/public/images/visa_service/2022/12/14/95a9e667eba5b9da5a7ad116f99afdea.jpeg b/public/images/visa_service/2022/12/14/95a9e667eba5b9da5a7ad116f99afdea.jpeg new file mode 100644 index 0000000..686aaa8 Binary files /dev/null and b/public/images/visa_service/2022/12/14/95a9e667eba5b9da5a7ad116f99afdea.jpeg differ diff --git a/resources/views/admin/news_and_update/create.blade.php b/resources/views/admin/news_and_update/create.blade.php index f1dffdd..507606b 100644 --- a/resources/views/admin/news_and_update/create.blade.php +++ b/resources/views/admin/news_and_update/create.blade.php @@ -47,6 +47,12 @@ +
+
+ + +
+
diff --git a/resources/views/admin/news_and_update/edit.blade.php b/resources/views/admin/news_and_update/edit.blade.php index 81dc978..0c54cc4 100644 --- a/resources/views/admin/news_and_update/edit.blade.php +++ b/resources/views/admin/news_and_update/edit.blade.php @@ -54,6 +54,18 @@
+
+
+ + +
+ + + + + +
+
diff --git a/resources/views/admin/news_and_update/index.blade.php b/resources/views/admin/news_and_update/index.blade.php index a12e06c..0f8dba3 100644 --- a/resources/views/admin/news_and_update/index.blade.php +++ b/resources/views/admin/news_and_update/index.blade.php @@ -58,6 +58,7 @@ Title Author Publish Date + Thumbnail Image Slug Status @@ -72,7 +73,12 @@ {{strip_tags($setting->title)}} {{$setting->author}} {{$setting->publish_date}} + + + + + diff --git a/resources/views/admin/visa_service/edit.blade.php b/resources/views/admin/visa_service/edit.blade.php index 35f1a2c..43a2592 100644 --- a/resources/views/admin/visa_service/edit.blade.php +++ b/resources/views/admin/visa_service/edit.blade.php @@ -19,14 +19,14 @@
-

Edit Service

-
List - Create +

Edit Visa Service

+ List + Create
@include('success.success') @include('errors.error') - {!! Form::open(['url' => '/admin/services/'.$service->id, 'class' => 'form-horizontal', 'method'=> 'POST','files' => true]) !!} + {!! Form::open(['url' => '/admin/visa_services/'.$service->id, 'class' => 'form-horizontal', 'method'=> 'POST','files' => true]) !!}
diff --git a/resources/views/layout/app.blade.php b/resources/views/layout/app.blade.php index b53d9f3..52cee9a 100644 --- a/resources/views/layout/app.blade.php +++ b/resources/views/layout/app.blade.php @@ -32,6 +32,7 @@ @php $services = \App\Models\Service::where('status','1')->orderByRaw('CONVERT(order_by, SIGNED) asc')->get(); + $visa_services = \App\Models\VisaService::where('status','1')->orderByRaw('CONVERT(order_by, SIGNED) asc')->get(); $facebook = App\Models\Setting::where(['slug' => 'facebook-link','status' => true])->first(); $instagram = App\Models\Setting::where(['slug' => 'instagram-link','status' => true])->first(); $linkedIn = App\Models\Setting::where(['slug' => 'linkedin-link','status' => true])->first(); @@ -53,11 +54,10 @@
@@ -210,17 +210,47 @@ diff --git a/resources/views/news.blade.php b/resources/views/news.blade.php index 67c680a..f2dc206 100644 --- a/resources/views/news.blade.php +++ b/resources/views/news.blade.php @@ -13,33 +13,35 @@
What’s New

News & Updates

- + @php + $news_and_update = $news_and_updates->where('blog_type',1)->first(); + @endphp
- @foreach($news_and_updates->skip(1) as $news) + @foreach($news_and_updates->where('blog_type','!=',1)->skip(1) as $news)
diff --git a/resources/views/services.blade.php b/resources/views/services.blade.php index 1b8b37d..bf965a0 100644 --- a/resources/views/services.blade.php +++ b/resources/views/services.blade.php @@ -27,7 +27,7 @@ @endif
- +