app/Http/Controllers/TrademarkController.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)
    {
        $data = new ThuongHieu();
        $data->tenHang = $request->input('tenHang');
        $data->slug = Str::slug($request->input('tenHang'));
        $trangThai=0;
        if($request->has('trangThai')){
            $trangThai=$request->input('trangThai');
        }
        $data->trangThai = $trangThai;
        $data->save();
        return redirect()->route('admin.trademark.index');
    }
public function store ( Request $ request ) { $ data = new ThuongHieu ( ) ; $ data -> tenHang = $ request -> input ( 'tenHang' ) ; $ data -> slug = Str :: slug ( $ request -> input ( 'tenHang' ) ) ; $ trangThai = 0 ; if ( $ request -> has ( 'trangThai' ) ) { $ trangThai = $ request -> input ( 'trangThai' ) ; } $ data -> trangThai = $ trangThai ; $ data -> save ( ) ; return redirect ( ) -> route ( 'admin.trademark.index' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .