已采納回答 / zhang_yuan_java
因為$student是一個在控制器中得到的實例對象,這個示例可以調用模型中的這些方法。而且模型中的這些方法,在控制器中的實例中,可以通過->with(['sex']),這樣的方法調用。在后期開發中經常這樣調用。
2017-01-07
建議不熟悉 中間件 的來看一下這里的資料學習一下
https://laravel-china.org/topics/687
講師似乎忘了給講這個東西了,在這節課程里剛開始就操作中間件可能會把人搞得一頭霧水...
https://laravel-china.org/topics/687
講師似乎忘了給講這個東西了,在這節課程里剛開始就操作中間件可能會把人搞得一頭霧水...
2017-01-06
在StudentController.php 里加上 use Session; 就可以解決Class 'App\Http\Controllers\Session' not found的問題了,親測有效!
2017-01-05
To use the class from the global namespace, place:
use Session;
on top of your controller, after your namespace declaration
Alternatively, you can call the class from the global namespace with:
\Session::get('panier');
use Session;
on top of your controller, after your namespace declaration
Alternatively, you can call the class from the global namespace with:
\Session::get('panier');
2017-01-05
最新回答 / 慕粉3413248
解決了,在上面使用foreach的時候@foreach($student as $student)這樣寫竟然會跟下面$student產生沖突,在foreach時@foreach($student as $val)就沒事了,,不懂背后原理。。。
2016-12-30