Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function userUpdate()
- {
- if(Input::get('send')) {
- $arr = [
- 'email' => Input::get('email')
- ];
- DB::table(Config::get('users_table'))->find(Input::get('userId'))->update(['is_active' => TRUE]);
- return redirect()->route('users');
- }
- }
- id bigserial NOT NULL,
- username text,
- email text,
- permission integer NOT NULL,
- is_staff boolean NOT NULL DEFAULT false,
- is_active boolean NOT NULL DEFAULT false,
- updated_at timestamp without time zone,
- created_at timestamp without time zone,
- remember_token text
- Route::post('/user/update', [
- 'as' => 'userUpdate', 'uses' => 'UserController@userUpdate'
- ]);
- {!! Form::open(['route' => 'userUpdate', 'method' => 'post']) !!}
- <label>Username</label>
- {!! Form::text('username', $user->username, ['class' => 'form-control readonly', 'readonly' => '']) !!}
- <label>Email</label>
- {!! Form::text('email', $user->email, ['class' => 'form-control']) !!}
- <label>Permission</label>
- {!! Form::text('permission', $user->permission, ['class' => 'form-control']) !!}
- {!! Form::hidden('userId', $user->id) !!}
- {!! Form::submit('Update User', ['class' => 'btn green', 'name' => 'send']) !!}
- {!! Form::submit('Cancel', ['class' => 'btn black', 'name' => 'clear']) !!}
- {!! Form::close() !!}
- public function userUpdate()
- {
- if(Input::get('send')) {
- $arr = [
- 'email' => Input::get('email')
- ];
- DB::table(Config::get('users_table'))->where('id',Input::get('userId'))->update(['is_active' => TRUE]);
- return redirect()->route('users');
- }
- }
- first() to limit(1)
- $blog = DB::table('blogs')
- ->where('blogs.id', $id)
- ->first();
- $blog = DB::table('blogs')
- ->where('blogs.id', $id)
- ->limit(1);
Add Comment
Please, Sign In to add comment