|
1
|
|
|
<?php namespace Arcanesoft\Seo\Http\Controllers\Admin; |
|
2
|
|
|
|
|
3
|
|
|
use Arcanesoft\Seo\Models\Meta; |
|
4
|
|
|
use Arcanesoft\Seo\Policies; |
|
5
|
|
|
|
|
6
|
|
|
/** |
|
7
|
|
|
* Class MetasController |
|
8
|
|
|
* |
|
9
|
|
|
* @package Arcanesoft\Seo\Http\Controllers\Admin |
|
10
|
|
|
* @author ARCANEDEV <[email protected]> |
|
11
|
|
|
* |
|
12
|
|
|
* @todo: Add authorization checks. |
|
13
|
|
|
*/ |
|
14
|
|
|
class MetasController extends Controller |
|
15
|
|
|
{ |
|
16
|
|
|
/* ----------------------------------------------------------------- |
|
17
|
|
|
| Constructor |
|
18
|
|
|
| ----------------------------------------------------------------- |
|
19
|
|
|
*/ |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* MetasController constructor. |
|
23
|
|
|
*/ |
|
24
|
|
|
public function __construct() |
|
25
|
|
|
{ |
|
26
|
|
|
parent::__construct(); |
|
27
|
|
|
|
|
28
|
|
|
$this->setCurrentPage('seo-metas'); |
|
29
|
|
|
$this->addBreadcrumbRoute(trans('seo::metas.titles.metas'), 'admin::seo.metas.index'); |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
/* ----------------------------------------------------------------- |
|
33
|
|
|
| Main Methods |
|
34
|
|
|
| ----------------------------------------------------------------- |
|
35
|
|
|
*/ |
|
36
|
|
|
|
|
37
|
|
|
public function index() |
|
38
|
|
|
{ |
|
39
|
|
|
$this->authorize(Policies\MetasPolicy::PERMISSION_LIST); |
|
40
|
|
|
|
|
41
|
|
|
$metas = Meta::query()->paginate(50); |
|
42
|
|
|
|
|
43
|
|
|
$this->setTitle($title = trans('seo::metas.titles.metas-list')); |
|
44
|
|
|
$this->addBreadcrumb($title); |
|
45
|
|
|
|
|
46
|
|
|
return $this->view('admin.metas.index', compact('metas')); |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
public function show(Meta $meta) |
|
50
|
|
|
{ |
|
51
|
|
|
$this->authorize(Policies\MetasPolicy::PERMISSION_SHOW); |
|
52
|
|
|
|
|
53
|
|
|
$meta->load(['seoable']); |
|
54
|
|
|
|
|
55
|
|
|
$this->setTitle($title = trans('seo::metas.titles.metas-details')); |
|
56
|
|
|
$this->addBreadcrumb($title); |
|
57
|
|
|
|
|
58
|
|
|
return $this->view('admin.metas.show', compact('meta')); |
|
59
|
|
|
} |
|
60
|
|
|
} |
|
61
|
|
|
|