diff --git a/app/Http/Controllers/backend/AnalyticsController.php b/app/Http/Controllers/backend/AnalyticsController.php index 716f0245..649e096f 100644 --- a/app/Http/Controllers/backend/AnalyticsController.php +++ b/app/Http/Controllers/backend/AnalyticsController.php @@ -28,7 +28,7 @@ protected function validator(Request $request, $id = '') */ public function index(Request $request) { - $page = Page::findOrFail(4); + $page = Page::find(4); $analytics = Analytic::all(); $users = User::get(); diff --git a/app/Http/Controllers/backend/EditLoginRegisterController.php b/app/Http/Controllers/backend/EditLoginRegisterController.php index 272f84d1..f15c50ab 100644 --- a/app/Http/Controllers/backend/EditLoginRegisterController.php +++ b/app/Http/Controllers/backend/EditLoginRegisterController.php @@ -79,7 +79,7 @@ public function store(Request $request) */ public function show($id) { - $page = Page::findOrFail($id); + $page = Page::find($id); return view('backEnd.pages.show', compact('page')); } @@ -91,7 +91,7 @@ public function show($id) */ public function edit($id) { - $page = Page::findOrFail($id); + $page = Page::find($id); return view('backEnd.pages.edit', compact('page')); } @@ -127,7 +127,7 @@ public function update(Request $request, $id) ->withErrors($this->validator($request)) ->withInput(); } - $page = Page::findOrFail($id); + $page = Page::find($id); $page->update($request->all()); Session::flash('message', 'Page updated!'); @@ -150,7 +150,7 @@ public function update(Request $request, $id) */ public function destroy($id) { - $page = Page::findOrFail($id); + $page = Page::find($id); $page->delete(); Session::flash('message', 'Page deleted!'); Session::flash('status', 'success'); diff --git a/app/Http/Controllers/backend/EditaboutController.php b/app/Http/Controllers/backend/EditaboutController.php index 254e7500..d4190fcd 100644 --- a/app/Http/Controllers/backend/EditaboutController.php +++ b/app/Http/Controllers/backend/EditaboutController.php @@ -28,7 +28,7 @@ public function index() { $layout = Layout::find(1); - $page = Page::findOrFail(2); + $page = Page::find(2); return view('backEnd.pages.edit_about', compact('page', 'layout')); } @@ -84,7 +84,7 @@ public function store(Request $request) */ public function show($id) { - $page = Page::findOrFail($id); + $page = Page::find($id); return view('backEnd.pages.show', compact('page')); @@ -99,7 +99,7 @@ public function show($id) */ public function edit($id) { - $page = Page::findOrFail($id); + $page = Page::find($id); return view('backEnd.pages.edit', compact('page')); } @@ -120,7 +120,7 @@ public function update($id, Request $request) // ->withErrors($this->validator($request)) // ->withInput(); // } - $page = Page::findOrFail($id); + $page = Page::find($id); $page->update($request->all()); $layout = Layout::find(1); if ($layout) { @@ -153,9 +153,9 @@ public function update($id, Request $request) */ public function destroy($id) { - $page = Page::findOrFail($id); + $page = Page::find($id); - $page->delete(); + $page?->delete(); Session::flash('message', 'Page deleted!'); Session::flash('status', 'success'); diff --git a/app/Http/Controllers/backend/EdithomeController.php b/app/Http/Controllers/backend/EdithomeController.php index 0ac50e78..4367505c 100644 --- a/app/Http/Controllers/backend/EdithomeController.php +++ b/app/Http/Controllers/backend/EdithomeController.php @@ -30,7 +30,7 @@ protected function validator(Request $request, $id = '') public function index() { try { - $page = Page::findOrFail(1); + $page = Page::find(1); $layout = Layout::find(1); return view('backEnd.pages.edit_home', compact('page', 'layout')); } catch (\Throwable $th) { @@ -79,7 +79,7 @@ public function store(Request $request) */ public function show($id) { - $page = Page::findOrFail($id); + $page = Page::find($id); return view('backEnd.pages.show', compact('page')); } @@ -93,7 +93,7 @@ public function show($id) */ public function edit($id) { - $page = Page::findOrFail($id); + $page = Page::find($id); return view('backEnd.pages.edit', compact('page')); } @@ -154,7 +154,7 @@ public function update($id, Request $request) ->withInput(); } - $page = Page::findOrFail($id); + $page = Page::find($id); $page->update($request->all()); Session::flash('message', 'Page updated!'); @@ -177,7 +177,7 @@ public function update($id, Request $request) */ public function destroy($id) { - $page = Page::findOrFail($id); + $page = Page::find($id); $page->delete(); diff --git a/app/Http/Controllers/backend/EditlayoutController.php b/app/Http/Controllers/backend/EditlayoutController.php index 545ac79f..c449734b 100644 --- a/app/Http/Controllers/backend/EditlayoutController.php +++ b/app/Http/Controllers/backend/EditlayoutController.php @@ -71,7 +71,7 @@ public function store(Request $request) */ public function show($id) { - $page = Page::findOrFail($id); + $page = Page::find($id); return view('backEnd.pages.show', compact('page')); } @@ -85,7 +85,7 @@ public function show($id) */ public function edit($id) { - $page = Page::findOrFail($id); + $page = Page::find($id); return view('backEnd.pages.edit', compact('page')); } @@ -189,9 +189,9 @@ public function update($id, Request $request) */ public function destroy($id) { - $page = Page::findOrFail($id); + $page = Page::find($id); - $page->delete(); + $page?->delete(); Session::flash('message', 'Page deleted!'); Session::flash('status', 'success'); diff --git a/app/Http/Controllers/backend/OtherAttributesController.php b/app/Http/Controllers/backend/OtherAttributesController.php index cdd2ee94..d3fe4037 100644 --- a/app/Http/Controllers/backend/OtherAttributesController.php +++ b/app/Http/Controllers/backend/OtherAttributesController.php @@ -145,8 +145,8 @@ public function update(Request $request, $id) */ public function destroy($id) { - $OtherAttribute = OtherAttribute::findOrFail($id); - $OtherAttribute->delete(); + $OtherAttribute = OtherAttribute::find($id); + $OtherAttribute?->delete(); Session::flash('message', 'Success! Attribute is deleted successfully.'); Session::flash('status', 'success'); diff --git a/app/Http/Controllers/backend/PagesController.php b/app/Http/Controllers/backend/PagesController.php index 1276d9fb..a00a8dcc 100644 --- a/app/Http/Controllers/backend/PagesController.php +++ b/app/Http/Controllers/backend/PagesController.php @@ -104,7 +104,7 @@ public function store(Request $request) */ public function show($id) { - $page = Page::findOrFail($id); + $page = Page::find($id); return view('backEnd.pages.show', compact('page')); } @@ -118,7 +118,7 @@ public function show($id) */ public function edit($id) { - $page = Page::findOrFail($id); + $page = Page::find($id); return view('backEnd.pages.edit', compact('page')); } @@ -139,7 +139,7 @@ public function update($id, Request $request) ->withInput(); } - $page = Page::findOrFail($id); + $page = Page::find($id); $page->update($request->all()); Session::flash('message', 'Page updated!'); @@ -157,7 +157,7 @@ public function update($id, Request $request) */ public function destroy($id) { - $page = Page::findOrFail($id); + $page = Page::find($id); $page->delete(); diff --git a/app/Http/Controllers/frontEnd/AnalyticsController.php b/app/Http/Controllers/frontEnd/AnalyticsController.php index 367a8918..e8b5238e 100644 --- a/app/Http/Controllers/frontEnd/AnalyticsController.php +++ b/app/Http/Controllers/frontEnd/AnalyticsController.php @@ -26,7 +26,7 @@ protected function validator(Request $request,$id='') */ public function index() { - $page = Page::findOrFail(4); + $page = Page::find(4); $analytics = Analytic::all(); return view('backEnd.pages.analytics', compact('page', 'analytics')); diff --git a/app/Http/Controllers/frontEnd/ExploreController.php b/app/Http/Controllers/frontEnd/ExploreController.php index cf06b3c3..edb8f2ad 100644 --- a/app/Http/Controllers/frontEnd/ExploreController.php +++ b/app/Http/Controllers/frontEnd/ExploreController.php @@ -277,7 +277,7 @@ public function filter(Request $request) $pdf = $request->input('pdf'); $csv = $request->input('csv'); - $layout = Layout::findOrFail(1); + $layout = Layout::find(1); $filter_label = $request->filter_label ? $request->filter_label : (Session::has('filter_label') ? Session::get('filter_label') : $layout->default_label); Session::put('filter_label', $filter_label); @@ -1283,7 +1283,7 @@ public function fetchService(Request $request) $query = $request->get('query'); if ($query) { $metas = MetaFilter::all(); - $layout = Layout::findOrFail(1); + $layout = Layout::find(1); $count_metas = MetaFilter::count(); $serviceNames = Service::query(); $organization_names = Organization::where('organization_name', 'like', '%' . $query . '%'); @@ -1406,7 +1406,7 @@ public function fetchOrganization(Request $request) $organization_names = Organization::where('organization_name', 'like', '%' . $query . '%')->orWhere('organization_alternate_name', 'like', '%' . $query . '%'); $metas = MetaFilter::all(); - $layout = Layout::findOrFail(1); + $layout = Layout::find(1); $count_metas = MetaFilter::count(); $filter_label = Session::has('filter_label') ? Session::get('filter_label') : $layout->default_label; diff --git a/app/Http/Controllers/frontEnd/MessageController.php b/app/Http/Controllers/frontEnd/MessageController.php index 704d445b..9508c25f 100644 --- a/app/Http/Controllers/frontEnd/MessageController.php +++ b/app/Http/Controllers/frontEnd/MessageController.php @@ -81,7 +81,7 @@ public function messagesSetting() $sendgridMailFromAddress = env('MAIL_FROM_ADDRESS'); $share_this_api = env('SHARETHIS_API'); $share_this_api_activate = env('SHARETHIS_ACTIVATE'); - $page = Page::findOrFail(4); + $page = Page::find(4); return view('backEnd.messages.messageSetting', compact('sendgridKey', 'sendgridMailFromName', 'sendgridMailFromAddress', 'share_this_api', 'share_this_api_activate', 'page')); } diff --git a/app/Http/Controllers/frontEnd/OrganizationController.php b/app/Http/Controllers/frontEnd/OrganizationController.php index bafea47b..5d08c08b 100644 --- a/app/Http/Controllers/frontEnd/OrganizationController.php +++ b/app/Http/Controllers/frontEnd/OrganizationController.php @@ -1006,7 +1006,7 @@ public function create() $all_services = Service::orderBy('service_name')->with('phone', 'address', 'taxonomy', 'schedules', 'details')->get(); $phone_languages = Language::orderBy('order')->whereNotNull('language_recordid')->pluck('language', 'language_recordid'); // service pop section - $layout = Layout::findOrFail(1); + $layout = Layout::find(1); $exclude_vocabulary = []; if ($layout) { $exclude_vocabulary = explode(',', $layout->exclude_vocabulary); @@ -1096,7 +1096,7 @@ public function store(Request $request) $new_recordid = Organization::max("organization_recordid") + 1; $organization->organization_recordid = $new_recordid; $organization_recordid = $new_recordid; - $layout = Layout::findOrFail(1); + $layout = Layout::find(1); $organization->organization_name = $request->organization_name; // $organization->organization_status_x = $request->organization_status_x; if ($layout && $layout->default_organization_status) { @@ -1928,7 +1928,7 @@ public function edit($id) $all_services = Service::with('phone', 'address', 'taxonomy', 'schedules', 'details')->get(); $phone_languages = Language::orderBy('order')->whereNotNull('language_recordid')->pluck('language', 'language_recordid'); // service pop section - $layout = Layout::findOrFail(1); + $layout = Layout::find(1); $exclude_vocabulary = []; if ($layout) { $exclude_vocabulary = explode(',', $layout->exclude_vocabulary); diff --git a/app/Http/Controllers/frontEnd/ServiceController.php b/app/Http/Controllers/frontEnd/ServiceController.php index be91709a..663bec9f 100644 --- a/app/Http/Controllers/frontEnd/ServiceController.php +++ b/app/Http/Controllers/frontEnd/ServiceController.php @@ -116,7 +116,7 @@ public function index() $checked_transportations = []; $checked_hours = []; $meta_status = 'On'; - $layout = Layout::findOrFail(1); + $layout = Layout::find(1); $metas = MetaFilter::all(); $count_metas = MetaFilter::count(); @@ -343,6 +343,7 @@ public function index() } $organizationStatus = OrganizationStatus::orderBy('order')->pluck('status', 'id'); + return view('frontEnd.services.services', compact('services', 'locations', 'map', 'parent_taxonomy', 'child_taxonomy', 'checked_organizations', 'checked_insurances', 'checked_ages', 'checked_languages', 'checked_settings', 'checked_culturals', 'checked_transportations', 'checked_hours', 'meta_status', 'grandparent_taxonomies', 'sort_by_distance_clickable', 'service_taxonomy_info_list', 'service_taxonomy_badge_color_list', 'organization_tagsArray', 'layout', 'service_tagsArray', 'sdoh_codes_category_Array', 'sdoh_codes_Array', 'organizationStatus'))->with('taxonomy_tree', $taxonomy_tree); } @@ -389,7 +390,7 @@ public function create() $service_status_list = ['Yes' => 'Yes', 'No' => 'No']; // $taxonomy_info_list = Taxonomy::select('taxonomy_recordid', 'taxonomy_name')->orderBy('taxonomy_name')->distinct()->get(); - $layout = Layout::findOrFail(1); + $layout = Layout::find(1); $exclude_vocabulary = []; if ($layout) { $exclude_vocabulary = explode(',', $layout->exclude_vocabulary); @@ -489,7 +490,7 @@ public function store(Request $request) ]); } try { - $layout = Layout::findOrFail(1); + $layout = Layout::find(1); $service = new Service; $service_recordids = Service::select("service_recordid")->distinct()->get(); $service_recordid_list = array(); @@ -1598,7 +1599,7 @@ public function edit($id) $service_location_list = Location::select('location_recordid', 'location_name')->get(); $service_contacts_list = Contact::select('contact_recordid', 'contact_name')->get(); - $layout = Layout::findOrFail(1); + $layout = Layout::find(1); $exclude_vocabulary = []; if ($layout) { $exclude_vocabulary = explode(',', $layout->exclude_vocabulary); diff --git a/resources/views/backEnd/messages/messageSetting.blade.php b/resources/views/backEnd/messages/messageSetting.blade.php index 4199c2ff..98396759 100644 --- a/resources/views/backEnd/messages/messageSetting.blade.php +++ b/resources/views/backEnd/messages/messageSetting.blade.php @@ -126,8 +126,8 @@ {!! Form::label('body', 'Google Analytics: ', ['class' => 'col-sm-3 control-label']) !!}
{{-- {!! Form::text('body', null, ['class' => 'form-control']) !!} --}} - - + @if ($errors->first('body')) diff --git a/resources/views/backEnd/pages/edit_home.blade.php b/resources/views/backEnd/pages/edit_home.blade.php index 70979cbc..e07fbbf5 100755 --- a/resources/views/backEnd/pages/edit_home.blade.php +++ b/resources/views/backEnd/pages/edit_home.blade.php @@ -137,7 +137,7 @@ class="optional form-control col-md-7 col-xs-12">{{$layout->sidebar_content_part
- +
diff --git a/resources/views/backEnd/pages/show.blade.php b/resources/views/backEnd/pages/show.blade.php index 85494002..8b281bbd 100755 --- a/resources/views/backEnd/pages/show.blade.php +++ b/resources/views/backEnd/pages/show.blade.php @@ -15,10 +15,10 @@ - {{ $page->id }} {{ $page->name }} {{ $page->title }} {{ $page->body }} + {{ $page?->id }} {{ $page?->name }} {{ $page?->title }} {{ $page?->body }} - +
-@endsection \ No newline at end of file +@endsection diff --git a/resources/views/layouts/analytics.blade.php b/resources/views/layouts/analytics.blade.php index 91c7fa93..392fb192 100644 --- a/resources/views/layouts/analytics.blade.php +++ b/resources/views/layouts/analytics.blade.php @@ -1,7 +1,7 @@ {{-- @if(config('app.env') != 'local') --}} - @include('layouts.analytics') +@include('layouts.analytics') {{-- @endif --}} @yield('customScript')