vendredi 6 mai 2016

Laravel 5.2 : delete() And forceDelete()

In My Controller :

public function destroy($id)
{
    $task = Task::findOrFail($id);
    if($task->forceDeleting){
      $task->forceDelete();
    }
    else {
      $task->delete();
    }
      return back();
}

In the above method the else section is working but the if is not working and throws error No query results for model [App\Task] with URI shows http://localhost/Final/public/todo/28

I am using the same method from views to softDeletes and Permanent Deletes.







from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/21FghsN
via IFTTT

Aucun commentaire:

Enregistrer un commentaire