kineticamobile / lumki

Laravel 8 Users Management. Add-on to Jetstream, using spatie/laravel-permissions & lab404/laravel-impersonate
Other
75 stars 26 forks source link

Publish the views and other code #12

Open ArtMin96 opened 3 years ago

ArtMin96 commented 3 years ago

It is a very good job. Thank you. Can you add an option to publish the views and other codes?

raultm commented 3 years ago

Thanks for share this issue.

In fact, you can already publish the views php artisan vendor:publish --tag=lumki.views

I don't understand what you mean when you mention publish "other codes" Can you give us more info?

ArtMin96 commented 3 years ago

Thanks.

I mean publish controllers and views so we can customize.

raultm commented 3 years ago

Do you know any package that publishes controllers?

I mean, laravel support publish views because you use a prefix for them, but for controllers you must explicit the namespace on the route.

ArtMin96 commented 3 years ago

Yes, I know Laravel UI.

For the namespace, there is no problem because Laravel has a standard structure App\Http\Controllers. There's an example https://github.com/laravel/ui/blob/3.x/stubs/Auth/LoginController.stub.

Anyway, thanks for the package.

raultm commented 3 years ago

The UI package is very specific, you MUST publish the controllers is not optional, In lumki case we specified the namespace of the controllers in the routes file

->namespace("Kineticamobile\Lumki\Controllers")

I need to evaluate if this could go wrong in any direction. In the case of publish the controller is mandatory publish the routes OR create a config parameter to modifiy the namespace. I don't know if is worth it.

We're going to check some possibilities

ArtMin96 commented 3 years ago

For routes files, you can keep that namespace but in stub files, it could be App\Http\Controllers.