Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Nov 14th, 2018 72 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. public function userUpdate()
  2. {
  3.     if(Input::get('send')) {
  4.         $arr = [
  5.             'email' => Input::get('email')
  6.         ];
  7.         DB::table(Config::get('users_table'))->find(Input::get('userId'))->update(['is_active' => TRUE]);
  8.         return redirect()->route('users');
  9.     }          
  10. }
  11.    
  12. id bigserial NOT NULL,
  13. username text,
  14. email text,
  15. permission integer NOT NULL,
  16. is_staff boolean NOT NULL DEFAULT false,
  17. is_active boolean NOT NULL DEFAULT false,
  18. updated_at timestamp without time zone,
  19. created_at timestamp without time zone,
  20. remember_token text
  21.    
  22. Route::post('/user/update', [
  23.     'as' => 'userUpdate', 'uses' => 'UserController@userUpdate'
  24. ]);
  25.    
  26. {!! Form::open(['route' => 'userUpdate', 'method' => 'post']) !!}
  27.  
  28. <label>Username</label>
  29. {!! Form::text('username', $user->username, ['class' => 'form-control readonly', 'readonly' => '']) !!}
  30.  
  31. <label>Email</label>
  32. {!! Form::text('email', $user->email, ['class' => 'form-control']) !!}
  33.  
  34. <label>Permission</label>
  35. {!! Form::text('permission', $user->permission, ['class' => 'form-control']) !!}
  36.  
  37. {!! Form::hidden('userId', $user->id) !!}
  38. {!! Form::submit('Update User', ['class' => 'btn green', 'name' => 'send']) !!}
  39. {!! Form::submit('Cancel', ['class' => 'btn black', 'name' => 'clear']) !!}
  40. {!! Form::close() !!}
  41.    
  42. public function userUpdate()
  43. {
  44. if(Input::get('send')) {
  45.     $arr = [
  46.         'email' => Input::get('email')
  47.     ];
  48.     DB::table(Config::get('users_table'))->where('id',Input::get('userId'))->update(['is_active' => TRUE]);
  49.     return redirect()->route('users');
  50. }          
  51. }
  52.    
  53. first() to limit(1)
  54.    
  55. $blog = DB::table('blogs')
  56.         ->where('blogs.id', $id)
  57.         ->first();
  58.    
  59. $blog = DB::table('blogs')
  60.         ->where('blogs.id', $id)
  61.         ->limit(1);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top