已采纳回答 / 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