-1
我想通過用戶角色 插入數據使用用戶角色來插入數據這裏是我的控制器如何在laravel 5.2
public function getWorks($class_id,Request $request)
{
@if(Auth::user()->role=="Teacher")
else if($validator->fails())
{
$works = new assainments();
$works -> title = $text;
//$works -> file = $fileName;
$works -> class_id = $class_id;
$works -> users_id = Auth::user()->id;
$works -> save();
}
@endif
}
我不能在這裏@if(Auth::user()->role=="Teacher")
使用。我如何使用這個?
Thnx bro ... Helpfull ... – Shuvo