plugin icon indicating copy to clipboard operation
plugin copied to clipboard

[Feature request] Scaffolding controller action from routing definition

Open gander opened this issue 4 years ago • 3 comments

Example routing definition:

    Route::get('/foo', 'FooBarController@foo')->name('foo');
    Route::post('/bar/{id}', 'FooBarController@bar')->name('bar');

Scaffolding via Show Context Actions menu action, on action fragment:

<?php

namespace App\Http\Controllers;

class FooBarController extends Controller
{
    public function foo()
    {
    }
    public function bar($id)
    {
    }
}

gander avatar Jul 07 '21 11:07 gander

Yes. It's a good idea. I'm thinking about it a lot. However, I think I can only create a class with 1 method with "Add Missing Controller" quick fix. And then... maybe add a new quick fix: "Add Missing Method"...

adelf avatar Jul 07 '21 11:07 adelf

Yes, that's what I meant, but I didn't know how to describe it. In case this is the first method, it would create the entire controller. In case the controller already existed, it would add a second method.

gander avatar Jul 07 '21 14:07 gander

@adelf What status?

gander avatar Dec 22 '21 09:12 gander

Has anything changed since the last comment?

gander avatar Feb 09 '23 19:02 gander