Skip to content

Commit

Permalink
Upgrade to PHP 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
digitaldreams committed Apr 14, 2024
1 parent 9d89105 commit 07a2e1d
Show file tree
Hide file tree
Showing 22 changed files with 116 additions and 194 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Policies/PagePolicy.php → Policies/PagePolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function before(User $user)
*/
public function index(User $user)
{
return false;
return true;
}

/**
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
],
"require": {
"php": "^8.0",
"php": "^8.2",
"laravel/framework": "^10.0|^11.0",
"digitaldream/data-converter": ">=1.0"
},
Expand Down
8 changes: 4 additions & 4 deletions src/Http/Controllers/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function index(Request $request)
'page_total' => Page::count(),
'meta_tag_total' => MetaTag::count(),
'setting_total' => Setting::count(),
'webmasterTags' => isset($metaTags['webmaster_tools']) ? $metaTags['webmaster_tools'] : []
'webmasterTags' => $metaTags['webmaster_tools'] ?? []
];
return view('seo::pages.dashboard.index', $data);
}
Expand All @@ -40,8 +40,8 @@ public function social()
$metaTags = MetaTag::forGlobal();
$data = [
'records' => Setting::paginate(10),
'og' => isset($metaTags['og']) ? $metaTags['og'] : [],
'twitter' => isset($metaTags['twitter']) ? $metaTags['twitter'] : [],
'og' => $metaTags['og'] ?? [],
'twitter' => $metaTags['twitter'] ?? [],
'model' => new Setting(),
];
return view('seo::pages.dashboard.social', $data);
Expand Down Expand Up @@ -76,4 +76,4 @@ public function advanced()
$data = [];
return view('seo::pages.dashboard.advanced', $data);
}
}
}
29 changes: 8 additions & 21 deletions src/Http/Controllers/ImageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ class ImageController extends Controller
/**
* Display a listing of the resource.
*
* @param Index $request
* @param Page $page
* @return Response
*/
*/
public function index(Index $request, Page $page)
{

Expand All @@ -43,10 +41,8 @@ public function index(Index $request, Page $page)
/**
* Show the form for creating a new resource.
*
* @param Create $request
* @param Page $page
* @return Response
*/
*/
public function create(Create $request, Page $page)
{
return view('seo::pages.images.create', [
Expand All @@ -59,10 +55,8 @@ public function create(Create $request, Page $page)
/**
* Store a newly created resource in storage.
*
* @param Store $request
* @param Page $page
* @return Response
*/
*/
public function store(Store $request, Page $page)
{
$model = new PageImage();
Expand All @@ -71,21 +65,20 @@ public function store(Store $request, Page $page)

if ($model->save()) {
session()->flash(config('seo.flash_message'), 'Image saved successfully');

return redirect()->route('seo::pages.images.index', $page->id);
} else {
session()->flash(config('seo.flash_error'), 'Something is wrong while saving Image');
}

return redirect()->back();
}

/**
* Show the form for editing the specified resource.
*
* @param Edit $request
* @param Page $page
* @param PageImage $pageImage
* @return Response
*/
*/
public function edit(Edit $request, Page $page, PageImage $pageImage)
{
return view('seo::pages.images.edit', [
Expand All @@ -97,11 +90,8 @@ public function edit(Edit $request, Page $page, PageImage $pageImage)
/**
* Update a existing resource in storage.
*
* @param Update $request
* @param Page $page
* @param PageImage $pageImage
* @return Response
*/
*/
public function update(Update $request, Page $page, PageImage $pageImage)
{
$pageImage->fill($request->all());
Expand All @@ -118,12 +108,9 @@ public function update(Update $request, Page $page, PageImage $pageImage)
/**
* Delete a resource from storage.
*
* @param Destroy $request
* @param Page $page
* @param PageImage $pageImage
* @return Response
* @throws \Exception
*/
*/
public function destroy(Destroy $request, Page $page, PageImage $pageImage)
{
if ($pageImage->delete()) {
Expand Down
25 changes: 8 additions & 17 deletions src/Http/Controllers/LinkTagController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ class LinkTagController extends Controller
/**
* Display a listing of the resource.
*
* @param Index $request
* @return \Illuminate\Http\Response
*/
*/
public function index(Index $request)
{
return view('linktag.index', ['records' => LinkTag::paginate(10)]);
Expand All @@ -33,9 +32,8 @@ public function index(Index $request)
/**
* Show the form for creating a new resource.
*
* @param Create $request
* @return \Illuminate\Http\Response
*/
*/
public function create(Create $request)
{
return view('linktag.create', [
Expand All @@ -46,9 +44,8 @@ public function create(Create $request)
/**
* Store a newly created resource in storage.
*
* @param Store $request
* @return \Illuminate\Http\Response
*/
*/
public function store(Store $request)
{
$model = new LinkTag;
Expand All @@ -57,42 +54,38 @@ public function store(Store $request)
if ($model->save()) {

session()->flash('app_message', 'LinkTag saved successfully');

return redirect()->route('seo_link_tags.index');
} else {
session()->flash('app_message', 'Something is wrong while saving LinkTag');
}

return redirect()->back();
}

/**
* Show the form for editing the specified resource.
*
* @param Edit $request
* @param LinkTag $linktag
* @return \Illuminate\Http\Response
*/
*/
public function edit(Edit $request, LinkTag $linktag)
{

return view('linktag.edit', [
'model' => $linktag,

]);
}

/**
* Update a existing resource in storage.
*
* @param Update $request
* @param LinkTag $linktag
* @return \Illuminate\Http\Response
*/
*/
public function update(Update $request, LinkTag $linktag)
{
$linktag->fill($request->all());

if ($linktag->save()) {

session()->flash('app_message', 'LinkTag successfully updated');
return redirect()->route('seo_link_tags.index');
} else {
Expand All @@ -104,11 +97,9 @@ public function update(Update $request, LinkTag $linktag)
/**
* Delete a resource from storage.
*
* @param Destroy $request
* @param LinkTag $linktag
* @return \Illuminate\Http\Response
* @throws \Exception
*/
*/
public function destroy(Destroy $request, LinkTag $linktag)
{
if ($linktag->delete()) {
Expand Down
24 changes: 7 additions & 17 deletions src/Http/Controllers/MetaTagController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ class MetaTagController extends Controller
/**
* Display a listing of the resource.
*
* @param Index $request
* @return Response
*/
*/
public function index(Index $request)
{
return view('seo::pages.meta_tags.index', ['records' => MetaTag::paginate(6)]);
Expand All @@ -37,9 +36,8 @@ public function index(Index $request)
/**
* Show the form for creating a new resource.
*
* @param Create $request
* @return Response
*/
*/
public function create(Create $request)
{
return view('seo::pages.meta_tags.create', [
Expand All @@ -50,9 +48,8 @@ public function create(Create $request)
/**
* Store a newly created resource in storage.
*
* @param Store $request
* @return Response
*/
*/
public function store(Store $request)
{
$model = new MetaTag;
Expand All @@ -71,10 +68,8 @@ public function store(Store $request)
/**
* Show the form for editing the specified resource.
*
* @param Edit $request
* @param MetaTag $meta_tag
* @return Response
*/
*/
public function edit(Edit $request, MetaTag $meta_tag)
{
return view('seo::pages.meta_tags.edit', [
Expand All @@ -85,10 +80,8 @@ public function edit(Edit $request, MetaTag $meta_tag)
/**
* Update a existing resource in storage.
*
* @param Update $request
* @param MetaTag $meta_tag
* @return Response
*/
*/
public function update(Update $request, MetaTag $meta_tag)
{
$meta_tag->fill($request->all());
Expand All @@ -104,9 +97,8 @@ public function update(Update $request, MetaTag $meta_tag)
}

/**
* @param Request $request
* @return \Illuminate\Http\RedirectResponse
*/
*/
public function global(Request $request)
{
$metaValues = $request->get('meta', []);
Expand All @@ -121,11 +113,9 @@ public function global(Request $request)
/**
* Delete a resource from storage.
*
* @param Destroy $request
* @param MetaTag $meta_tag
* @return Response
* @throws \Exception
*/
*/
public function destroy(Destroy $request, MetaTag $meta_tag)
{
if ($meta_tag->delete()) {
Expand Down
Loading

0 comments on commit 07a2e1d

Please sign in to comment.