1 | <?php namespace Arcanesoft\Blog\Http\Controllers\Foundation; |
||
12 | class PostsController extends FoundationController |
||
13 | { |
||
14 | /* ------------------------------------------------------------------------------------------------ |
||
15 | | Properties |
||
16 | | ------------------------------------------------------------------------------------------------ |
||
17 | */ |
||
18 | /** |
||
19 | * The post model. |
||
20 | * |
||
21 | * @var \Arcanesoft\Blog\Models\Post |
||
22 | */ |
||
23 | private $post; |
||
24 | |||
25 | /* ------------------------------------------------------------------------------------------------ |
||
26 | | Constructor |
||
27 | | ------------------------------------------------------------------------------------------------ |
||
28 | */ |
||
29 | /** |
||
30 | * Instantiate the controller. |
||
31 | * |
||
32 | * @param Post $post |
||
33 | */ |
||
34 | public function __construct(Post $post) |
||
43 | |||
44 | /* ------------------------------------------------------------------------------------------------ |
||
45 | | Main Functions |
||
46 | | ------------------------------------------------------------------------------------------------ |
||
47 | */ |
||
48 | /** |
||
49 | * List the posts. |
||
50 | * |
||
51 | * @param bool $trashed |
||
52 | * |
||
53 | * @return \Illuminate\View\View |
||
54 | */ |
||
55 | public function index($trashed = false) |
||
69 | |||
70 | /** |
||
71 | * List the trashed posts. |
||
72 | * |
||
73 | * @return \Illuminate\View\View |
||
74 | */ |
||
75 | public function trash() |
||
79 | |||
80 | public function create() |
||
84 | |||
85 | public function store() |
||
89 | |||
90 | public function show($post) |
||
94 | |||
95 | public function edit($post) |
||
99 | |||
100 | public function update($post) |
||
104 | |||
105 | public function publish($post) |
||
109 | |||
110 | public function restore($post) |
||
114 | |||
115 | public function delete($post) |
||
119 | } |
||
120 |
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: