1 | <?php |
||
13 | class AdministratorsController extends Controller |
||
14 | { |
||
15 | /** |
||
16 | * Page de liste des administrateurs. |
||
17 | */ |
||
18 | public function index() |
||
19 | { |
||
20 | $administrators = Administrators::all(); |
||
21 | |||
22 | return view('Administrators/index', [ |
||
23 | 'administrators' => $administrators, |
||
24 | ]); |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * To remove an administrators. |
||
29 | * |
||
30 | * @param $id |
||
31 | * |
||
32 | * @return mixed |
||
33 | */ |
||
34 | public function remove($id) |
||
35 | { |
||
36 | |||
37 | // To load an administrator |
||
38 | $administrator = Administrators::find($id); |
||
39 | |||
40 | if ($administrator) { |
||
41 | Session::flash('success', "L'administrateur {$administrator->email} a bien été supprimé"); |
||
42 | $administrator->delete(); |
||
43 | } |
||
44 | |||
45 | return Redirect::route('administrators_index'); |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * To remove an administrators. |
||
50 | * |
||
51 | * @param $id |
||
52 | * |
||
53 | * @return mixed |
||
54 | */ |
||
55 | public function create() |
||
59 | |||
60 | /** |
||
61 | * To store an administrators |
||
62 | * ARgument $id est facultatif: null est sa valeur par défaut. |
||
63 | */ |
||
64 | public function store(AdministratorsRequest $request, $id = null) |
||
107 | |||
108 | /** |
||
109 | * To edit an administrator. |
||
110 | * |
||
111 | * @param $id |
||
112 | * |
||
113 | * @return mixed |
||
114 | */ |
||
115 | public function edit($id) |
||
123 | } |
||
124 |
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.
If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.