framework icon indicating copy to clipboard operation
framework copied to clipboard

Type hinted dependencies on admin pages

Open jlambe opened this issue 5 years ago • 0 comments

Provide support for container auto-resolution of dependencies with type-hinted parameters on administration page controllers.

$page = Page::make('slug', 'Title)
    ->set();

$page->route('/', 'PageController@index');

Then we calling the index method to render the page, its depencies should be auto-injected. So we can define code like with the router:

public function index(Filesystem $files, Customer $customer)
{
    // Code here... with an instance of Filesystem and Customer model.
}

Early exploration may leverage the service container call method.

jlambe avatar Jul 29 '19 18:07 jlambe