How to delete record

Published 8 months ago by JokersMild85

What is the proper way to delete a record in Laravel? Does it have to go through the destroy method?

        if(!empty($request['delete']))
        {    
            foreach($request['delete'] as $delete)
            {
                $workout_exercise = WorkoutExercise::findOrFail($delete['id']);
                
                $workout_exercise->delete();
            }
        }
topvillas

No, do it in whatever method you want.

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