Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

208
Views
Call to a member function extension() on null
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

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!