Esempio n. 1
0
 /**
  * Get the ID for the currently authenticated user.
  *
  * @return int|null
  */
 public function id()
 {
     if ($this->loggedOut) {
         return;
     }
     $id = $this->session->get($this->getName(), $this->getRecallerId());
     if (is_null($id) && $this->user()) {
         $id = $this->user()->getAuthIdentifier();
     }
     return $id;
 }
Esempio n. 2
0
 /**
  * Flash a container of errors to the session.
  *
  * @param  \Nova\Support\Contracts\MessageProviderInterface|array  $provider
  * @param  string  $key
  * @return $this
  */
 public function withErrors($provider, $key = 'default')
 {
     $value = $this->parseErrors($provider);
     $this->session->flash('errors', $this->session->get('errors', new ViewErrorBag())->put($key, $value));
     return $this;
 }