This is a Laravel package which created to make your life easier. The package comes with most of everything you may need for develop large applications with less effort.
- Laravel Utils comes with
laravel-passport
already setup. - Login and CRUD for the User is implemented whith route middlewares.
- Permission system is implemented whith route middlewares.
- Laravel Utils comes with a status system defined.
-
Install the package via composer:
composer require caiocesar173/laravel-utils
-
Publish owenit via the following command:
php artisan vendor:publish --provider "OwenIt\Auditing\AuditingServiceProvider" --tag="config"
-
On your
config/auth
add the gurad api and place his driver as passport:'guards' => [ ... 'api' => [ 'driver' => 'passport', 'provider' => 'users', ], ],
-
On your
config/auth
inside providers replace de default User Model (App\Models\User::class):'providers' => [ ... 'users' => [ 'driver' => 'eloquent', 'model' => Caiocesar173\Utils\Entities\User::class, ], ],
-
Execute migrations via the following command:
php artisan migrate
-
Setup
laravel-passport
via the following command:php artisan passport:install
-
Seed the database via the following command:
php artisan db:seed
-
Done!
Additionally, the package comes with the laravel-pt-BR-localization
language support.
To install it, just do:
-
Publish the translation
php artisan vendor:publish --tag=laravel-pt-br-localization
-
On your
config/app.php
inlocale
replace de defaulten
with:'locale' => 'pt-BR',
-
On your
config/app.php
intimezone
replace de defaultUTC
with:'timezone' => 'America/Sao_Paulo',
-
Done!
On your config/services
add the provider api and place his driver as passport:
'provider_name' => [
client_id => env(PROVIDER_NAME_CLIENT_ID),
client_secret => env(PROVIDER_NAME_CLIENT_SECRET),
redirect => env(PROVIDER_NAME_URL_CALLBACK),
],
The Varibles accepted on .env
:
#In case you olny want to use the classes inside the package set the UTILS_ONLY_CLASSES=TRUE
UTILS_ONLY_CLASSES = FALSE
UTILS_GEOLOC_ENABLE = TRUE #GeoLoc: locatins, coins, language and internet and phone zones