Repository Trait
Accessing repositories from any class can be done by using RepositoryTrait
trait in your desired class.
#
Exampleapp\Http\Controllers\UsersControllers.php
The syntax here is to write down the repository alias name and append Repository
keyword after the repository alias name located in the config/mongez.php
.
config/mongez.php
This is exactly alais to the repo
helper function.
app\Http\Controllers\UsersControllers.php
Please Note
All Repositories
, base controllers
and resources
implement the repository trait by default so you can access any repositorty from anywhere.
::