本文整理汇总了PHP中app\models\Role::All方法的典型用法代码示例。如果您正苦于以下问题:PHP Role::All方法的具体用法?PHP Role::All怎么用?PHP Role::All使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Role
的用法示例。
在下文中一共展示了Role::All方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show(Request $request)
{
$hasil = '';
$name = "";
$email = "";
$phone = "";
$nip = "";
$department = "";
$idnyah = "xxx";
$resultRole = Role::All();
if ($request->input('as') != "add") {
$result1 = User::find($request->input('id'));
$name = $result1->name;
$email = $result1->email;
$avatar = $result1->avatar;
$idnyah = $result1->id;
$phone = $result1->phone;
$jabatan = $result1->jabatan;
$nip = $result1->nip;
$roles = $result1->roles->first();
}
return view('_layout.form.form-input-user-backend', compact('nip', 'phone', 'avatar', 'jabatan', 'name', 'email', 'idnyah', 'resultRole', 'roles'));
}
示例2: show
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show(Request $request)
{
$hasil = '';
$name = "";
$email = "";
$phone = "";
$nip = "";
$department = "";
$idnyah = "xxx";
$resultRole = Role::All();
if ($request->input('as') != "add") {
$result1 = DB::table('users')->where('id', $request->input('id'))->get();
foreach ($result1 as $rS) {
$name = $rS->name;
$email = $rS->email;
$idnyah = $rS->id;
$phone = $rS->phone;
$department = $rS->department;
$nip = $rS->nip;
}
}
return view('_layout.form-input-user-backend', compact('nip', 'phone', 'department', 'name', 'email', 'idnyah', 'resultRole'));
}