public function run()
 {
     Account::create(['name' => 'Acme', 'slug' => 'acme']);
 }
예제 #2
0
 public function run()
 {
     $user = new User(['email' => '*****@*****.**', 'firstname' => 'Zen', 'lastname' => 'Bot']);
     $user->setPassword('secret');
     Account::first()->users()->save($user);
 }
예제 #3
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()];
 }