1 | <?php namespace Arcanesoft\Seo\Http\Controllers\Admin; |
||
17 | class FootersController extends Controller |
||
18 | { |
||
19 | /* ----------------------------------------------------------------- |
||
20 | | Constructor |
||
21 | | ----------------------------------------------------------------- |
||
22 | */ |
||
23 | |||
24 | /** |
||
25 | * FootersController constructor. |
||
26 | */ |
||
27 | public function __construct() |
||
34 | |||
35 | /* ----------------------------------------------------------------- |
||
36 | | Main Methods |
||
37 | | ----------------------------------------------------------------- |
||
38 | */ |
||
39 | |||
40 | public function index() |
||
41 | { |
||
42 | $this->authorize(Policies\FootersPolicy::PERMISSION_LIST); |
||
43 | |||
44 | $footers = Footer::with(['page', 'seo'])->paginate(50); |
||
|
|||
45 | |||
46 | $this->setTitle($title = trans('seo::footers.titles.footers-list')); |
||
47 | $this->addBreadcrumb($title); |
||
48 | |||
49 | return $this->view('admin.footers.index', compact('footers')); |
||
50 | } |
||
51 | |||
52 | public function create() |
||
53 | { |
||
54 | $this->authorize(Policies\FootersPolicy::PERMISSION_CREATE); |
||
55 | |||
56 | $pages = Page::getSelectData(); |
||
57 | $locales = Locales::all(); |
||
58 | |||
59 | $this->setTitle($title = trans('seo::footers.titles.new-footer')); |
||
60 | $this->addBreadcrumb($title); |
||
61 | |||
62 | return $this->view('admin.footers.create', compact('pages', 'locales')); |
||
63 | } |
||
64 | |||
65 | public function store(CreateFooterRequest $request) |
||
66 | { |
||
67 | $this->authorize(Policies\FootersPolicy::PERMISSION_CREATE); |
||
68 | |||
69 | $footer = Footer::createOne( |
||
70 | $request->getValidatedData() |
||
71 | ); |
||
72 | |||
73 | $this->transNotification('created', ['name' => $footer->name], $footer->toArray()); |
||
74 | |||
75 | return redirect()->route('admin::seo.footers.show', [$footer]); |
||
76 | } |
||
77 | |||
78 | public function show(Footer $footer) |
||
89 | |||
90 | public function edit(Footer $footer) |
||
91 | { |
||
92 | $this->authorize(Policies\FootersPolicy::PERMISSION_UPDATE); |
||
104 | |||
105 | public function update(Footer $footer, UpdateFooterRequest $request) |
||
117 | |||
118 | public function delete(Footer $footer) |
||
128 | |||
129 | /* ----------------------------------------------------------------- |
||
130 | | Other Methods |
||
131 | | ----------------------------------------------------------------- |
||
132 | */ |
||
133 | |||
134 | /** |
||
135 | * Notify with translation. |
||
136 | * |
||
137 | * @todo: Refactor this method to the core package ? |
||
138 | * |
||
139 | * @param string $action |
||
140 | * @param array $replace |
||
141 | * @param array $context |
||
142 | * |
||
143 | * @return string |
||
144 | */ |
||
145 | protected function transNotification($action, array $replace = [], array $context = []) |
||
155 | } |
||
156 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: