app/Http/Controllers/CategoriesController.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)
    {
        if(auth()->user()->isAdmin()){	
            $this->validate($request,[	
                'categ_name'=>'required'	
            ]);	
            $category = new Category;	
            $category->name = $request->input('categ_name');	
            $category->save();	
            return redirect('/');	
        }	
        else abort(404);
    }
public function store ( Request $ request ) { if ( auth ( ) -> user ( ) -> isAdmin ( ) ) { $ this -> validate ( $ request , [ 'categ_name' => 'required' ] ) ; $ category = new Category ; $ category -> name = $ request -> input ( 'categ_name' ) ; $ category -> save ( ) ; return redirect ( '/' ) ; } else abort ( 404 ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// Create category	