Пример #1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     /**
      * Users
      */
     // ID 2
     \VisualAppeal\Connect\User::create(['first_name' => 'Arno', 'last_name' => 'Nym', 'email' => '*****@*****.**', 'password' => password_hash('Test', PASSWORD_DEFAULT), 'activated' => 1, 'activated_at' => \Carbon\Carbon::now()->subDays(5), 'last_login' => \Carbon\Carbon::now()->subDays(1)]);
     // ID 3 - NOT ACTIVATED
     \VisualAppeal\Connect\User::create(['first_name' => 'Tom', 'last_name' => 'Test', 'email' => '*****@*****.**', 'password' => password_hash('123456', PASSWORD_DEFAULT), 'activated' => 0, 'comment' => 'IBM']);
     // ID 4
     \VisualAppeal\Connect\User::create(['first_name' => 'Max', 'last_name' => 'Test', 'email' => '*****@*****.**', 'password' => password_hash('654321', PASSWORD_DEFAULT), 'activated' => 1, 'activated_at' => \Carbon\Carbon::now()->subDays(614), 'last_login' => \Carbon\Carbon::now()->subDays(12)]);
     // ID 1
     \VisualAppeal\Connect\ClientProfile::create(['client_id' => 4, 'title' => 'phone-private', 'value' => '+49 202 74617821']);
     // ID 2
     \VisualAppeal\Connect\ClientProfile::create(['client_id' => 4, 'title' => 'phone-business', 'value' => '+49 202 74617822']);
     // ID 5
     \VisualAppeal\Connect\User::create(['first_name' => 'Jack', 'last_name' => 'Bauer', 'email' => '*****@*****.**', 'password' => password_hash('24', PASSWORD_DEFAULT), 'activated' => 1, 'activated_at' => \Carbon\Carbon::now()->subDays(214), 'last_login' => \Carbon\Carbon::now()->subDays(4)]);
     // ID 6
     \VisualAppeal\Connect\User::create(['first_name' => 'Katy', 'last_name' => 'Holmes', 'email' => '*****@*****.**', 'password' => password_hash('tom', PASSWORD_DEFAULT), 'activated' => 1, 'activated_at' => \Carbon\Carbon::now()->subDays(872), 'last_login' => \Carbon\Carbon::now()->subDays(3)]);
     /**
      * Clients
      */
     // ID 1
     \VisualAppeal\Connect\Client::create(['first_name' => 'Max', 'last_name' => 'Black', 'form_of_address' => 'Prof. Dr.', 'email' => '*****@*****.**', 'website' => 'http://example.com', 'sex' => 'female', 'birthday' => '1980-04-12']);
 }
Пример #2
0
 /**
  * Validate the input and store the Client in the database.
  *
  * @param \Illuminate\Http\Request $request
  *
  * @return Response
  */
 public function store(Request $request)
 {
     $this->validate($request, $this->createClientRules);
     $client = Client::create(['first_name' => $request->input('first_name'), 'last_name' => $request->input('last_name'), 'form_of_address' => $request->input('form_of_address'), 'email' => $request->input('email'), 'website' => $request->input('website'), 'sex' => $request->input('sex'), 'birthday' => $request->input('birthday')]);
     if (!isset($client)) {
         abort(503);
     }
     return redirect()->route('client.show', ['client' => $client->id]);
 }
Пример #3
0
 /**
  * Create new random Client.
  *
  * @return \VisualAppeal\Connect\Client
  */
 protected function createClient()
 {
     return \VisualAppeal\Connect\Client::create(['first_name' => $this->faker->firstName, 'last_name' => $this->faker->lastName, 'email' => $this->faker->email, 'website' => $this->faker->url, 'sex' => $this->faker->boolean(50) ? 'male' : 'female', 'birthday' => $this->faker->date]);
 }