-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Trafford Fewster edited this page Nov 13, 2023
·
4 revisions
This is a simple Laravel Package for making access codes for you models that can then be used elsewhere such as in Door Control Systems.
This package can be installed in any Laravel app with ease, just follow the steps below:
- As this is a small side project it isn't hosted on Composer, you can still install via composer though by adding this Repo as a repository, you can add the below snippet under your
repositoriescomposer.json config.
{
"type": "vcs",
"url": "git@github.com:TraffordFewster/access-code.git"
}
- Run
composer require traffordfewster/access-code - In your
app.phpLaravel config addTraffordfewster\AccessCode\AccessCodeServiceProvider::classunder the Package Service Providers. - Run Migrations on your Laravel App.
Integrating with your model is quite simple, all you need todo is use the trait for example:
class YourModel extends Model
{
use Traffordfewster\AccessCode\Traits\InteractsWithAccessCodes
...
}
You will then have access to all the trait methods on your model with can be found here.