samedi 2 octobre 2021

Delete function in Laravel

I'm stuck in this function. I want to delete a document which has a many to many relationship between library and client. I think I'm doing something entirely wrong here.

Documents have id, id_client, id_biblio and file

I have no idea how to delete the file from the clientController

public function delete($id)
{
    $client_docs = ClientDocument::find($id);
    $client_docs->delete();

    return redirect()->back()->with('success', 'client has been Deleted');
}


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3ov0Nfg
via IFTTT

Aucun commentaire:

Enregistrer un commentaire