本文整理汇总了PHP中app\User::getUser方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getUser方法的具体用法?PHP User::getUser怎么用?PHP User::getUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\User
的用法示例。
在下文中一共展示了User::getUser方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Displays the view for the Admin control panel.
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function index()
{
if (!$this->authorize('show-admin')) {
redirect('home');
}
$data = ['page_title' => 'Admin Dashboard', 'users' => User::getUser(), 'num_users' => User::getNumOfUsers(), 'roles' => Role::all(), 'num_admins' => User::getNumAdmins(), 'centers' => Fund::all()];
return view('admin.dashboard', $data);
}
示例2: modifyuser
public function modifyuser(Request $request)
{
$id = $request->get('id', null);
$user_model = new User();
$user = $user_model->getUser(['id' => $id]);
$data = ['id' => $id, 'user' => $user];
return view('ajax/admin/muser', $data)->renderSections();
}
示例3: create
public function create($id)
{
//
$model = new Article();
$article = $model->getArticle(["id" => $id]);
$usrlike = new UserLikeModel();
$islike = $usrlike->islike(['Article_id' => $id, 'User_id' => \Session::get('id')]);
$user_model = new User();
if ($article) {
$user = $user_model->getUser(['id' => $article->Users_id]);
}
return view("article.index", ["article" => $article, 'islike' => $islike, 'author' => $user]);
}
示例4: create
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
//
$usrlike = new UserLikeModel();
$user_model = new User();
if ($Uid = \Session::get('id')) {
$user = $user_model->getUser(['id' => $Uid]);
$attributes = ['User_id' => $Uid];
$alllikes = $usrlike->getAll($attributes, ['Article_id']);
$article_model = new Article();
$articles = null;
foreach ($alllikes as $Aid) {
$articles[] = $article_model->getArticle(['id' => $Aid->Article_id]);
}
}
return view("user.create", ['articles' => $articles, 'alllikes' => $alllikes, 'user' => $user]);
}
示例5: show
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
//
$user_like_model = new UserLikeModel();
$article_model = new Article();
$user_model = new User();
$ids = $user_like_model->getAll(['User_id' => $id], ['Article_id']);
$articles = [];
$index = 0;
foreach ($ids->items() as $item) {
$tmp = $article_model->getArticle(['id' => $item->Article_id]);
$articles[$index]['title'] = strip_tags($tmp->title);
$articles[$index]['content'] = strip_tags($tmp->content);
$articles[$index]['author'] = $user_model->getUser(['id' => $tmp->Users_id], ['name'])->name;
$articles[$index]['created_at'] = $tmp->created_at;
$articles[$index]['updated_at'] = $tmp->updated_at;
++$index;
}
$response = [];
$response['s'] = '1';
$response['msg'] = 'okay!';
$response['articles'] = $articles;
die(json_encode($response));
}
示例6: login
/**
* Function handles the login part
* @param Request $request
* @return string
*/
public function login(Request $request)
{
header('Access-Control-Allow-Origin: *');
$return = 'success';
$user = new User();
$email = $request->input('email');
$password = $request->input('password');
$loginUser = $user->getUser($email);
if (strcmp($loginUser, 'failure') == 0) {
$return = 'failure';
} else {
if ($user->checkPassword($loginUser, $password)) {
$return = 'success';
} else {
$return = 'failure';
}
}
if (strcmp($return, 'success') == 0) {
$return = $user->getUser($email);
}
return $return;
}
示例7: getDashboard
/**
* Used to display the view of the main dashboard and also pass
* along all of the variables and methods needed.
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function getDashboard()
{
$data = ['page_title' => 'Dashboard', 'users' => User::getUser(), 'centers' => Fund::all(), 'num_centers_in_red' => Balance::getNumOfCentersInRed(), 'num_centers_in_black' => Balance::getNumOfCentersInRed(true), 'center_data' => Fund::getSeparateCenterAccounts()];
return view('dashboard.dashboard', $data);
}
示例8: edit
public function edit($id)
{
$data = ['user' => User::getUser($id), 'roles' => Role::all(), 'centers' => Center::all()];
return view('user.edit-user', $data);
}