1 | <?php |
||
5 | trait HasResourceActions |
||
6 | { |
||
7 | /** |
||
8 | * Update the specified resource in storage. |
||
9 | * |
||
10 | * @param int $id |
||
11 | * @return \Illuminate\Http\Response |
||
12 | */ |
||
13 | public function update($id) |
||
17 | |||
18 | /** |
||
19 | * Store a newly created resource in storage. |
||
20 | * |
||
21 | * @return mixed |
||
22 | */ |
||
23 | public function store() |
||
27 | |||
28 | /** |
||
29 | * Remove the specified resource from storage. |
||
30 | * |
||
31 | * @param int $id |
||
32 | * @return \Illuminate\Http\Response |
||
33 | */ |
||
34 | public function destroy($id) |
||
50 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: