1 | <?php |
||
13 | class PageController extends Controller |
||
14 | { |
||
15 | /** |
||
16 | * Display a listing of the resource. |
||
17 | * |
||
18 | * @return \Illuminate\Http\Response |
||
19 | */ |
||
20 | public function index() |
||
24 | |||
25 | /** |
||
26 | * Show the form for creating a new resource. |
||
27 | * |
||
28 | * @return \Illuminate\Http\Response |
||
29 | */ |
||
30 | public function create() |
||
39 | |||
40 | /** |
||
41 | * Store a newly created resource in storage. |
||
42 | * |
||
43 | * @param NewsStoreRequest $request |
||
44 | * @return \Illuminate\Http\JsonResponse |
||
45 | */ |
||
46 | public function store(NewsStoreRequest $request) |
||
73 | |||
74 | /** |
||
75 | * Display the specified resource. |
||
76 | * |
||
77 | * @param int $id |
||
78 | * @return \Illuminate\Http\Response |
||
79 | */ |
||
80 | public function show($id) |
||
84 | |||
85 | /** |
||
86 | * Show the form for editing the specified resource. |
||
87 | * |
||
88 | * @param News $news |
||
89 | * @return \Illuminate\Http\Response |
||
90 | */ |
||
91 | public function edit(News $news) |
||
99 | |||
100 | /** |
||
101 | * Update the specified resource in storage. |
||
102 | * |
||
103 | * @param \Illuminate\Http\Request $request |
||
104 | * @param int $id |
||
105 | * @return \Illuminate\Http\Response |
||
106 | */ |
||
107 | public function update(Request $request, $id) |
||
111 | |||
112 | /** |
||
113 | * Remove the specified resource from storage. |
||
114 | * |
||
115 | * @param int $id |
||
116 | * @return \Illuminate\Http\Response |
||
117 | */ |
||
118 | public function destroy($id) |
||
122 | } |
||
123 |
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: