Support the ongoing development of Laravel.io →
Views Packages Architecture

Howdy,

So I have a admin package that contains a BaseAdminController class and I also have other packages (users, pages, blog etc.).

Now, I would like to be able to declare the index() method in my BaseAdminController (as per: http://laravel.io/bin/E3oJ9) so that I can use it across all my other packages.

How do you handle having to declare the package name with the View::make(). For example:

View::make('users.admin.index');

Thanks in advance!

Last updated 3 years ago.
0

I'd define a class property that would handle this. Something like $namespace or similar. You can then use:

View::make($this->namespace.".admin.index")

Last updated 3 years ago.
0

Ok, that does make sense, I did have that thought also but I wasn't 100% sure if that was the best way to handle it.

I think ill do it though! Thanks for your help!

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.