Ejemplo n.º 1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     User::create(['first_name' => "Admin", 'last_name' => 'Admin', 'email' => "*****@*****.**", 'password' => bcrypt("admin123")]);
     Entity::create(['name' => 'Product', 'unique_key' => 'product']);
     Entity::create(['name' => 'Category', 'unique_key' => 'category']);
     //Think again... do we need root category???
     //Category::create(['name' => 'Root', 'slug' => 'root', 'status' => 1, 'parent_category_id' => 0]);
 }
Ejemplo n.º 2
0
 public function update(Request $request)
 {
     try {
         $user = Auth::user();
         $userModel = User::findorfail($user->id);
         $userModel->update($request->all());
         return redirect('/admin');
     } catch (\Exception $e) {
         throw new Exception("User update Error");
     }
 }
Ejemplo n.º 3
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     User::create(['first_name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
     return Customer::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
 }
Ejemplo n.º 4
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array $data
  * @return User
  */
 protected function create(array $data)
 {
     return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
 }