本文整理汇总了PHP中Confide::user方法的典型用法代码示例。如果您正苦于以下问题:PHP Confide::user方法的具体用法?PHP Confide::user怎么用?PHP Confide::user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Confide
的用法示例。
在下文中一共展示了Confide::user方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: home
/**
* @return $this
*/
public function home()
{
if (Confide::User()) {
$this->dsp->content = Confide::user()->getContent();
}
return View::make('dispatch')->with(['dsp' => $this->dsp]);
}
示例2: update
/**
* Update the specified pet in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
$pet = Pet::findOrFail($id);
$data = Input::all();
$data['user_id'] = Confide::user()->id;
$validator = Validator::make($data, Pet::$rules);
$response = [];
$response['data'] = $data;
if ($validator->fails()) {
$response['success'] = false;
$response['errors'] = $validator->errors();
if (Request::ajax()) {
return Response::json($response);
} else {
return Redirect::back()->withErrors($validator->errors());
}
}
$pet->update($data);
$response['success'] = true;
$response['errors'] = [];
if (Request::ajax()) {
return Response::json($response);
} else {
return Redirect::action('UsersController@showProfile', Confide::user()->id);
}
}
示例3: login
/**
* Displays the login form
*
* @return Illuminate\Http\Response
*/
public function login()
{
if (Confide::user()) {
return Redirect::to('/');
} else {
return View::make(Config::get('confide::login_form'));
}
}
示例4: login
/**
* Displays the login form
*
* @return Illuminate\Http\Response
*/
public function login()
{
if (Confide::user()) {
return Redirect::to('/home');
} else {
return View::make('site.user.login');
}
}
示例5: isExist
/**
* @param $club_id
* @return bool
*/
public static function isExist($club_id)
{
$count = DB::table('userclubs')->where('user_id', '=', Confide::user()->id)->where('club_id', '=', $club_id)->count();
if ($count == 0) {
return false;
}
return true;
}
示例6: login
/**
* Displays the login form
*
* @return Illuminate\Http\Response
*/
public function login()
{
if (Confide::user()) {
return Redirect::route('backend.challenges.index');
} else {
return View::make(Config::get('confide::login_form'));
}
}
示例7: validateRoles
/**
* Provide an array of strings that map to valid roles.
* @param array $roles
* @return stdClass
*/
public function validateRoles(array $roles)
{
$user = Confide::user();
$roleValidation = new stdClass();
foreach ($roles as $role) {
$roleValidation->{$role} = empty($user) ? false : $user->hasRole($role);
}
return $roleValidation;
}
示例8: getIndex
public function getIndex()
{
$user = Confide::user();
if (!$user->isStaff() && Patient::find($user->id) == null) {
return Redirect::route('patient.create');
} else {
return View::make('home/index', compact('user'));
}
}
示例9: login
/**
* Displays the login form
*
* @return Illuminate\Http\Response
*/
public function login()
{
SEOMeta::setTitle(Lang::get("tags.login"));
if (Confide::user()) {
return Redirect::to('/');
} else {
return View::make(Config::get('confide::login_form'));
}
}
示例10: login
/**
* Displays the login form
*
* @return Illuminate\Http\Response
*/
public function login()
{
if (Confide::user()) {
return Redirect::to('/');
} else {
$title = 'League Together - Login';
return View::make('app.default.login')->with('page_title', $title);
//return View::make(Config::get('confide::login_form'));
}
}
示例11: uploadUserImage
public function uploadUserImage()
{
$user = Confide::user();
$user->img_path = $this->getAndMoveFile('file');
if ($user->save()) {
return Redirect::action('UsersController@show', $user->id);
} else {
throw new Exception("user image not updated!");
}
}
示例12: login
/**
* Displays the login form
*
*/
public function login()
{
if (\Confide::user()) {
// If user is logged, redirect to internal
// page, change it to '/admin', '/dashboard' or something
return Redirect::to('/');
} else {
$this->renderPage(array("content_view" => Config::get('confide::login_form')));
}
}
示例13: showAll
public function showAll()
{
$user = Confide::user();
$patients = Patient::join('user', 'user.id', '=', 'patient.user_id')->get();
if ($user->isStaff()) {
return View::make('home.patient.show-all', compact('user', 'patients'));
} else {
return Redirect::route('home.index');
}
}
示例14: createComment
public function createComment($conversation)
{
$user = Confide::user();
$comment = new Comment();
$comment->conversation_id = $conversation->id;
$comment->user_id = $user->id;
$comment->fill(Input::all());
$comment->save();
return Redirect::route('conversation.show', array($conversation->id));
}
示例15: logAudit
public static function logAudit($entity, $action, $description)
{
$audit = new Audit();
$audit->date = date('Y-m-d');
$audit->description = $description;
$audit->user = Confide::user()->username;
$audit->entity = $entity;
$audit->action = $action;
$audit->save();
}