Skip to content

Commit

Permalink
Merge pull request #141 from sarapis/feedback-changes
Browse files Browse the repository at this point in the history
Fix 404 on edit page
  • Loading branch information
d9it committed Mar 13, 2024
2 parents f6a1da7 + 4fac727 commit 366bee9
Show file tree
Hide file tree
Showing 17 changed files with 93 additions and 88 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/backend/AnalyticsController.php
Expand Up @@ -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();

Expand Down
8 changes: 4 additions & 4 deletions app/Http/Controllers/backend/EditLoginRegisterController.php
Expand Up @@ -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'));
}

Expand All @@ -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'));
}
Expand Down Expand Up @@ -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!');
Expand All @@ -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');
Expand Down
12 changes: 6 additions & 6 deletions app/Http/Controllers/backend/EditaboutController.php
Expand Up @@ -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'));
}
Expand Down Expand Up @@ -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'));
Expand All @@ -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'));
}
Expand All @@ -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) {
Expand Down Expand Up @@ -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');
Expand Down
10 changes: 5 additions & 5 deletions app/Http/Controllers/backend/EdithomeController.php
Expand Up @@ -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) {
Expand Down Expand Up @@ -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'));
}
Expand All @@ -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'));
}
Expand Down Expand Up @@ -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!');
Expand All @@ -177,7 +177,7 @@ public function update($id, Request $request)
*/
public function destroy($id)
{
$page = Page::findOrFail($id);
$page = Page::find($id);

$page->delete();

Expand Down
8 changes: 4 additions & 4 deletions app/Http/Controllers/backend/EditlayoutController.php
Expand Up @@ -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'));
}
Expand All @@ -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'));
}
Expand Down Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/backend/OtherAttributesController.php
Expand Up @@ -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');
Expand Down
8 changes: 4 additions & 4 deletions app/Http/Controllers/backend/PagesController.php
Expand Up @@ -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'));
}
Expand All @@ -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'));
}
Expand All @@ -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!');
Expand All @@ -157,7 +157,7 @@ public function update($id, Request $request)
*/
public function destroy($id)
{
$page = Page::findOrFail($id);
$page = Page::find($id);

$page->delete();

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/frontEnd/AnalyticsController.php
Expand Up @@ -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'));
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/frontEnd/ExploreController.php
Expand Up @@ -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);
Expand Down Expand Up @@ -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 . '%');
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/frontEnd/MessageController.php
Expand Up @@ -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'));
}

Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/frontEnd/OrganizationController.php
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down
9 changes: 5 additions & 4 deletions app/Http/Controllers/frontEnd/ServiceController.php
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions resources/views/backEnd/messages/messageSetting.blade.php
Expand Up @@ -126,8 +126,8 @@
{!! Form::label('body', 'Google Analytics: ', ['class' => 'col-sm-3 control-label']) !!}
<div class="col-sm-6">
{{-- {!! Form::text('body', null, ['class' => 'form-control']) !!} --}}
<input class="form-control" type="text" value="{{ '*******' . substr($page->body, -3) }}" name="body1" id="body1" disabled>
<input class="form-control" type="text" value="{{ $page->body }}" name="body"
<input class="form-control" type="text" value="{{ $page?->body ? '*******' . substr($page?->body, -3) : '' }}" name="body1" id="body1" disabled>
<input class="form-control" type="text" value="{{ $page?->body }}" name="body"
id="body2" style="display: none;" required>
<button type="button" id="changeAnalyticKey">Change</button>
@if ($errors->first('body'))
Expand Down
2 changes: 1 addition & 1 deletion resources/views/backEnd/pages/edit_home.blade.php
Expand Up @@ -137,7 +137,7 @@ class="optional form-control col-md-7 col-xs-12">{{$layout->sidebar_content_part
</label>
<div class="col-md-6 col-sm-12">
<div class="row">
<img src="/uploads/images/{{$layout->homepage_background}}" id="home_bk_img" style="width: 100%;">
<img src="/uploads/images/{{$layout?->homepage_background}}" id="home_bk_img" style="width: 100%;">
</div>
<div class="row">
<div class="col-md-6">
Expand Down
6 changes: 3 additions & 3 deletions resources/views/backEnd/pages/show.blade.php
Expand Up @@ -15,10 +15,10 @@
</thead>
<tbody>
<tr>
<td>{{ $page->id }}</td> <td> {{ $page->name }} </td><td> {{ $page->title }} </td><td> {{ $page->body }} </td>
<td>{{ $page?->id }}</td> <td> {{ $page?->name }} </td><td> {{ $page?->title }} </td><td> {{ $page?->body }} </td>
</tr>
</tbody>
</tbody>
</table>
</div>

@endsection
@endsection
2 changes: 1 addition & 1 deletion resources/views/layouts/analytics.blade.php
@@ -1,7 +1,7 @@
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ $analytics?->body }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
Expand Down

0 comments on commit 366bee9

Please sign in to comment.