app/Http/Controllers/BrandController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request)
    {
        $request->validate([
            'brand_name' => ['required','min:3','unique:brands'],
            'slug' => ['required'],
        ]);
        $brand = new Brand;
        $brand->brand_name = $request->brand_name;
        $brand->slug = $request->slug;
        $brand->save();
        return back()->with('success','Data Inserted Successfully');
    }
public function store ( Request $ request ) { $ request -> validate ( [ 'brand_name' => [ 'required' , 'min:3' , 'unique:brands' ] , 'slug' => [ 'required' ] , ] ) ; $ brand = new Brand ; $ brand -> brand_name = $ request -> brand_name ; $ brand -> slug = $ request -> slug ; $ brand -> save ( ) ; return back ( ) -> with ( 'success' , 'Data Inserted Successfully' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .