本文整理汇总了PHP中app\Profile::loginProfile方法的典型用法代码示例。如果您正苦于以下问题:PHP Profile::loginProfile方法的具体用法?PHP Profile::loginProfile怎么用?PHP Profile::loginProfile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Profile
的用法示例。
在下文中一共展示了Profile::loginProfile方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
public function update(ProfileRequest $request)
{
$values = [];
foreach ($request->rules() as $field => $rules) {
$values[$field] = $request->input($field);
}
Profile::loginProfile()->update($values);
flash()->info('The profile has been updated');
return redirect(route('home'));
}
示例2: update
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update(PasswordRequest $request)
{
$user = Profile::loginProfile()->user;
if (Hash::check($request->input('old_password'), $user->password)) {
// The passwords match...
$user->password = bcrypt($request->input('password'));
$user->save();
Flash::info('Password Updated');
return redirect(route('home'));
}
$errors = [];
$errors['old_password'] = 'Invalid old password';
return $request->response($errors);
}
示例3: link_to_sorting
public static function link_to_sorting($route, $view, $col, $title = null, $attributes = [])
{
if (is_null($title)) {
$title = str_replace('_', ' ', $col);
$title = ucfirst($title);
}
$order_by = Profile::loginProfile()->getOrderBy($view);
if (!is_array($order_by)) {
$order_by = [];
}
$indicator = array_has($order_by, $col) ? $order_by[$col] === 'asc' ? '↓' : '↑' : null;
$parameters = [$col, Profile::loginProfile()->getOrderByValue($view, $col) === 'asc' ? 'desc' : 'asc'];
return link_to_route($route, "{$title}{$indicator}", $parameters, $attributes);
}
示例4: getFilter
public function getFilter()
{
$values = [];
foreach ($this->filter_fields as $field) {
$values[$field] = Profile::loginProfile()->getFilterValue($this->index_view, $field);
}
return $values;
}
示例5: index
/**
* @return \Illuminate\View\View
*/
public function index()
{
$filter = $this->getFilter();
$models = $this->getModels($filter)->with('owner');
$models = $models->paginate(Profile::loginProfile()->per_page);
return view($this->index_view, compact('models', 'filter'));
}
示例6: FilterByLabel
public static function FilterByLabel($view)
{
$filters = Profile::loginProfile()->getFilters($view);
$values = [];
foreach ($filters as $key => $value) {
if (trim($value) != '') {
$values[] = "{$key}: {$value}";
}
}
return implode(' | ', $values);
}