Пример #1
0
 /**
  *	Invitation Token
  *	Get related models.
  *
  *	@param	string	$token
  */
 public static function withinvitation($token)
 {
     # Return user and account
     return [User::whereHas('accounts', function ($q) use($token) {
         $q->where('account_user.invitation_token', $token);
     })->first(), Account::whereHas('users', function ($q) use($token) {
         $q->where('account_user.invitation_token', $token);
     })->first()];
 }
Пример #2
0
 public function run()
 {
     $user = new User(['email' => '*****@*****.**', 'firstname' => 'Zen', 'lastname' => 'Bot']);
     $user->setPassword('secret');
     Account::first()->users()->save($user);
 }
 public function run()
 {
     $client = new Oauth2Client();
     $client->setClientId()->setClientSecret()->setName('Project app')->setRedirectUri('http://localhost/projectapp/auth.html');
     User::first()->oauth2clients()->save($client);
 }