app/Http/Controllers/TagsController.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)
    {
        $this->validate($request,[
            'name' => 'required|max:20|min:3'
        ]);
        Tags::create([
            'name' => $request->name,
            'slug' => Str::slug($request->name)
        ]);
        return redirect()->back()->with('success', 'Data berhasil Di Simpan');
    }
public function store ( Request $ request ) { $ this -> validate ( $ request , [ 'name' => 'required|max:20|min:3' ] ) ; Tags :: create ( [ 'name' => $ request -> name , 'slug' => Str :: slug ( $ request -> name ) ] ) ; return redirect ( ) -> back ( ) -> with ( 'success' , 'Data berhasil Di Simpan' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
//disini mengontrol halaman intent setelah kita menambah data