lundi 19 mars 2018

Pass a variable into constructor via app->make()

I have a repo and a eloquentrepo, see code. Now I want to pass a var into the constructor via the app->make()

Is that possible and how can I achieve that?

app()->(TestRepository::class)->getItem(TestModel::TEST_ITEM);

class EloquentTestRepository implements TestRepository {
    __construct($var){
        // do something with the $var
    }
}



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2u1tJ3J
via IFTTT

Aucun commentaire:

Enregistrer un commentaire