Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function verify() {
- $username = Input::get('username');
- $password = Input::get('password');
- if (!Admin::count()) {
- $user = new Admin;
- $user->username = Input::get('username');
- $user->password = $user->password = Hash::make(Input::get('password'));
- $user->save();
- return Redirect::to('/admin/login');
- } else {
- if (Auth::attempt(array('username' => $username, 'password' => $password))) {
- echo("i m in if");
- if (Session::has('pre_admin_login_url')) {
- $url = Session::get('pre_admin_login_url');
- Session::forget('pre_admin_login_url');
- return Redirect::to($url);
- } else {
- $admin = Admin::where('username', 'like', '%' . $username . '%')->first();
- Session::put('admin_id', $admin->id);
- return Redirect::to('/admin/report')->with('notify', 'installation Notification');
- }
- } else {
- return Redirect::to('/admin/login?error=1');
- }
- }
- use UserTrait, RemindableTrait;
- /**
- * The database table used by the model.
- *
- * @var string
- */
- protected $table = 'admin';
- /**
- * The attributes excluded from the model's JSON form.
- *
- * @var array
- */
- protected $hidden = array('password', 'remember_token');'
- Result:SQLSTATE[HY000]: General error: 1364 Field 'remember_token' doesn't have a default value (SQL: insert into `admin` (`username`, `password`, `updated_at`, `created_at`)values(admin@taxinow.com,y$csyEcrhERoQEszmxNmiOG.bcAZtwC8xeGiF2xyKTd2YLhEbjixm.m,2017-09-21 08:34:24, 2017-09-21 08:34:24))Any help would be appreciated. Thanks.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement