本文整理汇总了PHP中Confide类的典型用法代码示例。如果您正苦于以下问题:PHP Confide类的具体用法?PHP Confide怎么用?PHP Confide使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Confide类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
}
示例2: home
/**
* @return $this
*/
public function home()
{
if (Confide::User()) {
$this->dsp->content = Confide::user()->getContent();
}
return View::make('dispatch')->with(['dsp' => $this->dsp]);
}
示例3: 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;
}
示例4: getlivrabileFactura
public function getlivrabileFactura($id_factura)
{
$ids = self::getIDsDepartamente(Confide::getDepartamenteUser());
$sql = self::getlivrabileFacturateNefacturate($id_factura, true);
$factura = self::getFactura($id_factura);
$livrabile = DB::select($sql);
return View::make('livrabile_factura.list')->with('livrabile', $livrabile)->with('factura', $factura);
}
示例5: 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'));
}
}
示例6: 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;
}
示例7: 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!");
}
}
示例8: 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();
}
示例9: 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');
}
}
示例10: 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));
}
示例11: getEditInvestitie
public function getEditInvestitie($id)
{
$departamente = Confide::getDepartamenteUser();
$tva = self::getCoteTVA();
$imobil_class = new \Codecorner\Imobil\Controllers\ImobileController();
$imobile = $imobil_class->getImobil();
$cheltuieli = self::getCheltuieliSF();
$investitie = DB::select("SELECT\n investitie.id,\n investitie.denumire,\n investitie.cota_indiviza_spatii_locuit,\n investitie.cota_indiviza_spatii_alta_destinatie,\n investitie.finantare_nerambursabila_por,\n investitie.cofinantare_ap_eligibil,\n investitie.cofinantare_uat_eligibil,\n investitie.cofinantare_ap_neeligibil_ad,\n investitie.cofinantare_uat_neeligibil,\n investitie.cofinantare_ap_neeligibil_sl,\n investitie.id_imobil,\n investitie.id_departament,\n investitie.id_tva,\n l.denumire AS localitate,\n j.denumire AS judet,\n i.adresa\n FROM por12_investitie investitie\n INNER JOIN imobil i ON i.id = investitie.id_imobil AND i.logical_delete = 0\n LEFT OUTER JOIN judet j ON j.id_judet = i.id_judet AND j.logical_delete = 0\n LEFT OUTER JOIN localitate l ON l.id_localitate = i.id_localitate AND l.logical_delete = 0\n WHERE investitie.id = :id_investitie", array('id_investitie' => $id));
return View::make('investitie_por_axa12.edit')->with('investitie', $investitie[0])->with('imobile', $imobile)->with('tva', $tva)->with('finantare_nerambursabila_por', 60)->with('cofinantare_ap_neeligibil_ad', 100)->with('departamente', self::object_to_array($departamente))->with('cheltuieli', $cheltuieli);
}
示例12: index
/**
* Display a listing of notifications
*
* @return Response
*/
public function index()
{
$data = Input::all();
$pagination = Input::has('pagination') ? Input::get('pagination') : 10;
// FILTRA RESULTADOS
$notifications = Notification::where(function ($query) {
switch (Input::get('view')) {
case 'next':
// AGENDADAS
$query->where('date', '>', date('Y-m-d H:i:s'));
break;
case 'all':
// $query->where( 'user_id', Confide::user()->id );
break;
default:
// NÃO LIDAS
$query->where('date', '<', date('Y-m-d H:i:s'))->where('status', 0);
break;
}
if (Input::has('type')) {
$query->where('type', Input::get('type'));
}
if (Input::has('owner_type')) {
$query->where('owner_type', Input::get('owner_type'));
}
if (Input::has('owner_id')) {
$query->where('owner_id', Input::get('owner_id'));
}
if (Input::has('order')) {
$query->orderBy('date', Input::get('order'));
}
})->where('user_id', Confide::user()->id)->orderBy('date', Input::get('order', 'DESC'))->paginate($pagination);
switch (Input::get('view', 'unread')) {
case 'next':
$labels['nothing'] = 'Nenhuma notificação agendada';
break;
case 'all':
$labels['nothing'] = 'Nenhuma notificação ainda';
break;
default:
// case 'unread'
$labels['nothing'] = 'Nenhuma notificação não lida';
break;
}
$labels['count_next'] = Notification::where('user_id', Confide::user()->id)->where('date', '>', date('Y-m-d H:i:s'))->count();
$labels['count_all'] = Notification::where('user_id', Confide::user()->id)->count();
$labels['count_unread'] = Notification::where('user_id', Confide::user()->id)->where('date', '<', date('Y-m-d H:i:s'))->where('status', false)->count();
//$notifications->getCollection()->paginate( $pagination );//->paginate( $pagination ;
if (Request::ajax()) {
return View::make('notifications.panels.index', compact('notifications', 'labels'));
} else {
return View::make('notifications.index', compact('notifications', 'labels'));
}
}
示例13: add
/**
* @param string $backUrl
* @param int $club_id
* @return \Illuminate\Http\RedirectResponse
*/
public function add($backUrl = 'home', $club_id = 0)
{
if ($club_id == 0) {
return Redirect::route($backUrl);
}
$userclub = new Userclub();
$userclub->user_id = Confide::user()->id;
$userclub->club_id = $club_id;
$userclub->save();
return Redirect::route($backUrl);
}
示例14: __construct
public function __construct()
{
// Fetch the User object, or set it to false if not logged in
if (Confide::User()) {
$this->logged_in_user = Confide::User();
} else {
$this->logged_in_user = false;
}
View::share('logged_in_user', $this->logged_in_user);
View::share('success_message', $this->success_message);
}
示例15: getBalance
public function getBalance($wallet_id)
{
$balance = 0;
if (!Auth::guest()) {
$user = Confide::user();
$balanceCoin = Balance::where('user_id', '=', $user->id)->where('wallet_id', '=', $wallet_id)->first();
if (isset($balanceCoin->amount)) {
$balance = $balanceCoin->amount;
}
}
return $balance;
}