/** * Run the migrations. * * @return void */ public function up() { Schema::create('admins', function ($table) { $table->increments('id'); $table->string('username'); $table->string('password'); $table->string('name'); $table->string('remember_token'); $table->timestamps(); }); \LevApp\Models\Admin::create(['username' => '*****@*****.**', 'password' => bcrypt('test')]); }
public function delete($id) { $admin = Admin::findOrFail($id); $admin->delete(); return $this->success(); }
public function index() { \LevApp\Models\Admin::create(['username' => '*****@*****.**', 'password' => Hash::make('test')]); return view('admin::login'); }
public function importUsers() { $oldUsers = DB::connection('old')->table('users')->get(); foreach ($oldUsers as $oldUser) { if ($oldUser->user_type == 'admin') { $admin = new Admin(); $admin->username = $oldUser->email; $admin->name = $oldUser->name; $admin->password = bcrypt('howardsoffa'); $admin->save(); } else { $user = new User(); $user->name = $oldUser->name; $user->username = $oldUser->email; $user->company_id = $oldUser->company_id; $user->password = bcrypt('howardsoffa'); $user->save(); } } }