Deleting data from database using Laravel 8


I’m stuck with an issue relating to deleting data from my database

The DELETE method is not supported for this route. Supported methods: GET, HEAD. –

My controller for deleting –

public function destroy($id) {

        $project = Projects::findOrFail($id);
        return redirect('/')->with('msg', 'Your project is now done');

My form for deleting the data –

form action="/projects/{{ $project->id }}" method="POST">

            <button>Finish your project</button>

My route –

Route::delete('/projects/{id}', [ProjectController::class, 'destroy']);

Migration –

public function up() {

        Schema::create('projects', function (Blueprint $table) {

And lastly my models –

class Projects extends Model {

    use HasFactory;
    protected $casts = [
        'extra' => 'array'


I used php artisan cache:clear at some point when debugging, which enables and clears cache. So the changes in my web.php routes file were not being applied, as they were cached.

Ty for the help guys ! 🙂

Answered By – Paul

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published