Good morning I want to save the brand, image and status in the database; I'm using
When I click on save I get the following error, which can be the problem? Thanks for your input.
This is my Route
Route::resource('marca','Controladores\marca');
driver:
public function store(Request $request)
{
$photo = $request->file('image');
$filename = time() . '.' . $photo->getClientOriginalExtension();
Image::make($photo)->resize(350,350)->save(public_path('images/marca/' . $filename));
$imagen->image = $filename;
$imagen->save();
return view('Marca.crear');
}
View:
{!!Form::open(['route'=>'marca.store', 'method'=>'POST', 'files'=>true])!!}
<div class="form-group form-float">
<div class="form-line">
{!!Form::text('nombre',null,['id'=>'nombre','class'=>'form-control'])!!}
{!!Form::label('name','Marca', array('class' => 'form-label'))!!}
</div>
</div>
{!!Form::label('Imagen')!!}
{!!Form::file('image', null, array('id' => 'imagen'))!!}
<br>
{!!Form::label('Estado')!!}
<div class="switch">
<label>INACTIVO
{!!Form::checkbox('checkbox','value','true')!!}
<span class="lever">
</span>ACTIVO</label>
</div>
<br>
<!-- <button class="btn btn-primary waves-effect" type="submit">REGISTRAR</button> -->
{!!Form::submit('REGISTRAR',['name'=>'registrar', 'id'=>'registrar', 'class'=>'btn btn-primary waves-effect'])!!}
{!!Form::close()!!}