It would be great if we can choose custom BREAD controller just like we can choose custom model

Currently this can be done by overwriting routes, however what is your ideas here?
My Ideas are, when creating BREAD, we can choose our custom controller like
Controller Name :
App\Http\Controllers\ProductCoffeeController
btw how can I overwrite routes? Do I just put it on top of Voyager::routes()?
Under Voyager::routes() you can make overwrites like:
Route::get('/login', function () {
return redirect('my-other-login-page');
});
Now the /admin/voyager will redirect instead.
Pinging some of the good guys for their thoughts on this.
@thedevdojo @tnylea @abdgad @akazorg @handiwijoyo @Frondor @fletch3555
Maybe something like this:
$defaultController = $namespacePrefix.'VoyagerBreadController';
foreach (DataType::all() as $dataType) {
$breadController = $defaultController;
// if data type has set a custom bread controller
if ($dataType->controller) {
$breadController = $dataType->controller;
}
Route::resource($dataType->slug, $breadController);
}
I like that approach @abdgad.
I like that too @abdgad.
I think this feature is a must and most users will love it.
I can create a PR later for that.
Preparing PR for this, in progress...
This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.
Most helpful comment
Maybe something like this: