Nosean
6 months ago

Resource Controller destroy method

Posted 6 months ago by Nosean

I would like to delete a record. I have only one string (Categorie_name) as ID. My Link:

<a href="{{ route('admin.categorie.destroy', ['categorie_name' => $key]) }}"><i class="fas fa-trash-alt"></i></a>

and my web.php:

Route::resource('categorie', 'AdminCategorieController');

and my Controller:

    public function destroy(Categorie $categorie_name)
    {
        // Id finden anhand der Categorie_name Varibale


        $categorie_id = DB::table('categories')
                        ->where('categorie_name', '=', '$categorie')->first();

        dd($categorie_id)

    }

After clicking on link comes only an empty page instead of the DD dump.

Can anyone Help ?

Please sign in or create an account to participate in this conversation.