1 | <?php |
||
9 | class CategoryController extends Controller |
||
10 | { |
||
11 | /** |
||
12 | * Display a listing of the resource. |
||
13 | * |
||
14 | * @return \Illuminate\Http\Response |
||
15 | */ |
||
16 | public function index() |
||
19 | |||
20 | /** |
||
21 | * Show the form for creating a new resource. |
||
22 | * |
||
23 | * @return \Illuminate\Http\Response |
||
24 | */ |
||
25 | public function create() |
||
28 | |||
29 | /** |
||
30 | * Store a newly created resource in storage. |
||
31 | * |
||
32 | * @param \Chriscreates\Blog\Requests\ValidateCategoryRequest $request |
||
33 | * @return \Illuminate\Http\Response |
||
34 | */ |
||
35 | public function store(ValidateCategoryRequest $request) |
||
45 | |||
46 | /** |
||
47 | * Display the specified resource. |
||
48 | * |
||
49 | * @param \Chriscreates\Blog\Category $category |
||
50 | * @return \Illuminate\Http\Response |
||
51 | */ |
||
52 | public function show(Category $category) |
||
55 | |||
56 | /** |
||
57 | * Show the form for editing the specified resource. |
||
58 | * |
||
59 | * @param \Chriscreates\Blog\Category $category |
||
60 | * @return \Illuminate\Http\Response |
||
61 | */ |
||
62 | public function edit(Category $category) |
||
65 | |||
66 | /** |
||
67 | * Update the specified resource in storage. |
||
68 | * |
||
69 | * @param \Illuminate\Http\Request $request |
||
70 | * @param \Chriscreates\Blog\Requests\ValidateCategoryRequest $request |
||
71 | * @return \Illuminate\Http\Response |
||
72 | */ |
||
73 | public function update(ValidateCategoryRequest $request, Category $category) |
||
76 | |||
77 | /** |
||
78 | * Remove the specified resource from storage. |
||
79 | * |
||
80 | * @param \Chriscreates\Blog\Category $category |
||
81 | * @return \Illuminate\Http\Response |
||
82 | */ |
||
83 | public function destroy(Category $category) |
||
86 | } |
||
87 |
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: