Support the ongoing development of →
Configuration IOC Packages
Last updated 2 years ago.

Not that I'm aware of. What do you need it for?

Last updated 2 years ago.

Hey! Thanks man. I'm just thinking to build an admin (for backend) menu for a CMS, just trying to build a customiszable dynamic menu, depending on packages as modules (Gallery, Posts, Pages, Texonomies, terms etc) I want to build the menu. Thinking like WordPress. It's not for any project just built a sample application for a book (Laravel reference guide), so It came on my mind, but it could be useful for this kind of things. Thanks! BTW, what you are up to ? Don't see anything new on your blog.

Any thoughts on this to accomplish, scenario:

On the early stage of admin routing, build the admin menu depending on some modules/classes, don't know actually but hope you got it. Just, thinking like WordPress admin menu where a developer can also modify the menu items by adding his.her own or removing one depending on a role/permissions.

Last updated 2 years ago.

Ah yeah in that case you'd probably just need to keep your own running record of packages that can act as plugins for your CMS and either mark them as enabled/disabled in a DB or manifest of some sort.

As for the menu you'd probably want to have some kind of menu class that handles it all and each plugin would have a file or method in its service provider that is fired by your backend. It would be given an instance of the menu class that it can manipulate. Then you'd just need a view to render the menu that was generated by the menu class.

That's how I'd look at doing it. Something like that anyway. :P

Also, been busy with work! Planning on blogging again soon.

Last updated 2 years ago.

Thanks, all the best :-)

Last updated 2 years ago.

Why not just parse the composer.lock file? I have something similar going, to make a trait compatible with a couple different versions.


if (!function_exists('get_package_version')) {
     * @param string $packageName
     * @return string
    function get_package_version($packageName)
        $file = get_include_path().'/../composer.lock';
        $packages = json_decode(file_get_contents($file), true)['packages'];
        foreach ($packages as $package) {
            if ($package['name'] == $packageName) {
                return $package['version'];
        return null;

Then inside my trait:

$package = 'toin0u/geocoder-laravel';
$geolocationVersion = get_package_version($package);
if (!$geolocationVersion) {
    throw new \Exception("Please install the '$package' package");

if (version_compare($geolocationVersion, '4.0', '<')) {


Sign in to participate in this thread!


Your banner here too?

heera heera Joined 11 Feb 2014


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

Your logo here?

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

© 2024 - All rights reserved.