Support the ongoing development of Laravel.io →
posted 10 years ago
Packages
Last updated 2 years ago.
0

in other word, how i understand a module before installed? with database? and every time module is loaded, check for install?

Last updated 2 years ago.
0

solved. in modules routes.php:

Event::subscribe('Test1');

and in module Test1 class:

<?php

use Classes\Validate;

class Test1 extends \Classes\Module\Module
{

    public function __construct()
    {
        $this->name = 'Test2';
        $this->author = 'test author';
    }

    public function subscribe($events)
    {
        $events->listen('modules.install.' . $this->name, 'Test1@install');
    }

    public function install()
    {
        dd('events for install method work pretty');
    }
}

and fire events:

$this->app['events']->fire('modules.install.' . $this->name);
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

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.

© 2024 Laravel.io - All rights reserved.