Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should --view-path="admin" Be used in Routes/Redirects/etc #28

Closed
vita10gy opened this issue Oct 30, 2015 · 4 comments
Closed

Should --view-path="admin" Be used in Routes/Redirects/etc #28

vita10gy opened this issue Oct 30, 2015 · 4 comments

Comments

@vita10gy
Copy link

To say I'm "very new to Laravel" would be an understatement, but we're looking to transition from a custom thing to something like laravel. One of the things I like about our custom approach is we can generate a full CRUD process from a given DB table. Hence why I'm interested in this project.

We like to have all these admin things in /admin/ (though might not be the end of the world to let that go) and I see you have --view-path="admin" as an option. Problem is it only seems to matter for the blades (which I realize is the views).

However, if you do that, nothing seems to work until you get everything else working at /admin/widget which takes a change to the route file, any urls in the blades, and the redirects in the controller.

Am I missing something obvious, or should all those other changes be implied by --view-path="admin" as well?

@sohelamin
Copy link
Owner

Hi @vita10gy,

--view-path="admin" option will let you separate the view files.
This generator will allow you to separate the controller in different directory.

If you like to put your controller to separate directory and want to add prefix on route as well then
You need to do it manually.

Make the route as like

Route::group(['prefix' => 'admin', 'namespace' => 'Admin'], function () {
Route::get('crud', function () {
// Matches The "/admin/crud" URL
});
});

Make your controller namespace as like
namespace App\Http\Controllers\Admin;

Put the controller file to the directory
app/Http/Controllers/Admin

Thanks

@vita10gy
Copy link
Author

How possible would making some parameter to automate that be?

@sohelamin
Copy link
Owner

I will be added this feature soon.

@sohelamin
Copy link
Owner

Hi @vita10gy check this features on new version.
And let me know your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants