In your controller
$user = new User;
$user->name = 'value_from_form';
$user->password= 'value_from_form';
$user->checkbox= 'selected_value_from_form';
$user->save();
And in blade add your select boxes with the values Form::checkbox('name', 'value');
I don't think I understand what you're doing here very well...
you're creating an object User and saving it but it's all hard coded in the controller.
The field
$user->checkbox= 'selected_value_from_form';
I understand, the question I'm asking is how do I show a select box in my view that retrieves data from a "SELECT * FROM access"
and create a SELECT box with fields from the Access table in the "Create new User View"
I don't know if I'm making myself clear...
In routes.php
Route::get('/', function(){
$items = DB::table('Access')->get();
return View::make('Your_View')->with('items',$items);
});
in your View
@foreach($items as $item )
{{ Form::label('the access level ', $item->access_level) }}
{{ Form::checkbox('access', $item->id ) }}
@endforeach
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community