public function store(Request $post){
$messages = ['brand'=>'Brand not included','logo'=>'Image not included'];
$post->validate(['brand'=>'required|unique:brands|max:20',
'image'=>'nullable|nimes:jpg,jpeg,png,gif,svg|max:2048'],$messages);
$brandsId = $post->id;
if($brandsId){
$brands = Clients::find($brandsId);
if($post->hasFile('photo')){
$file = time().'.'.$post->logo->extension();
$post->logo->storeAs('public/uploads/images',$file);
$brands->logo = 'storage/uploads/images/'.$file;
}
}else{
$file = time().'.'.$post->logo->extension();
$post->logo->storeAs('public/uploads/images',$file);
$brands = new Brands();
$brands->logo = 'storage/uploads/images/'.$file;
}
$brands->brand = $post->brand;
$brands->save();
return response()->json($brands);
}
When I edit the file I get this error C:\wamp64\www\StockCrud\app\Http\Controllers\BrandsController.php