Download the PHP package devtools-marvellous/laravel-core-kit without Composer
On this page you can find all versions of the php package devtools-marvellous/laravel-core-kit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download devtools-marvellous/laravel-core-kit
More information about devtools-marvellous/laravel-core-kit
Files in devtools-marvellous/laravel-core-kit
Package laravel-core-kit
Short Description Main Core Code for starter project modules and extensions
License MIT
Informations about the package laravel-core-kit
Core Kit
To start project you should have locally installed:
php@^7.4|^8.0
,composer
. \ You can use google search with requests:linux php local install
,brew install php
. \ After first setup project can work via Valet or docker containers.
Main Core Code for starter project modules and extensions
- [x] What is CoreKit micro service
- [x] How to install from private repository
- [x] Installation Guide
- [x] Extension possibilities
What is CoreKit micro service
After installing CoreKit microservice you will receive next services out of the box:
- Authorization microservice. Sign-in, Sign-out, verification and password reset processes. Also, any other verification actions can be developed through Core Verification Broker.
- User registration.
- Profile get and update.
- Backend management system for users.
- Permissions and roles management system.
- SPA application fake routing. CoreKit give you powerful feature to make fake routes for SPA endpoints.
How to install from private repository
!!!!Never commit the auth.json file to your repository. For docker containerization use Vault or other secure variables to store access token for a user.
-
Run
- Add this into your composer.json:
Installation Guide
Step by step instructions, that will help you start a new project to build something amazing.
- [x] Directories and project environment
- [x] Setup project files
Directories and project environment
List of root directories for future project:
project-files
- contain all code files.docker
- contains all scripts for docker containerization process.docs
- contain all readme.md doc files.terraform
- contain all terraform templates for AWS resources setup.
You can find full description about each directory setup below.
Replace directories and project names to the real project name.
Setup project files
Create root directory of the project. For example, attract-starter-kit
:
After that you are ready for project-files
install:
Set up attract starter kit
TIMELESS - operations that will be changed after several steps.
Follow this TODO list to set up starter project:
- [x] Change default php requirements in composer.json to
^7.4|^8.0
- [x] Authorize your composer into private packagist
-
[x] [TIMELESS] Configure
DB_CONNECTION
to use sqlite driver into your.env
: -
[x] Disable mysql configuration strict mode to prevent errors on cross relations ordering in sextant operations:
-
[x] Run:
- [x] Remove all default laravel migrations
-
[x] Run
vendor:publish
operations to create configuration environment for new project: -
[x] Go into terraform directory and run:
-
[x] Update
./config/auth.php
api driver from token to passport: -
[x] Add
'read_write_timeout' => 0
to your./config/database.php
redis section: - [x] Remove
api.php
andweb.php
route files. -
[x] Change verified middleware into Core version
AttractCores\LaravelCoreKit\Http\Middleware\EnsureEmailIsVerified
inKernel.php
: - [x] Copy new app key(
APP_KEY
) from.env
into.env.example
and.env.dev
- [x] Copy
.env.example
->.env
. If you will use docker skip this row. If you are using Laravel Valet, set up variables for your local environment. -
[x] Update DatabaseSeeder via:
-
[x] If you will add new permissions/roles then you should extend
AttractCores\LaravelCoreAuth\Database\Seeders\DefaultRolesAndPermissionsSeeder
class and add new models like parent class do. For example: - [x] You require to follow Laravel Valet for local serving.
-
[x] If you are using Laravel Valet, then follow below steps:
-
Update migrations if needed and run below command if you are using Laravel Valet:
- After migrations processed we should create passport keys and clients:
-
- [x] Serve app via docker or Laravel Valet and move farther.
- [x] Update
APP_KIT_AUTH_PASSWORD_GRANT_CLIENT_ID
andAPP_KIT_AUTH_PASSWORD_GRANT_CLIENT_SECRET
variables values in.env
. Update them in./docker/local/envs/{YOUR_ENV}
if you are using docker. -
[x] In case of changes inside exception handler and validation messages structure we need add some updates into tests, to prevent failing:
-
Update
OauthTest.php
class by adding this function: - Update
RegisterTest.php
adn add replace oftestApiRegistrationValidation
function:
-
- [x] Remove
./tests/Feature/ExampleTest.php
file. - [x] For DEV/STAGE environment setup use this docs.
-
[x] After all actions, just run below command inside docker container or in
project-files
root(if using Valet): - [x] If green status obtained, starter kit ready to extend.
Extension possibilities
Any core request, controller, resource or library can be easily extended via Laravel service providers bind features.
After
vendor:publish
process yourAppServiceProvider
already include all necessary functions for extension.
User resource extension
After CoreKit installation project will grow, so we will need to extend default user resource with new relation expands. Let's do this.
For example: we need to separate fist_name and last_name fields. Don't forget to update the migration.
Also, we should update App\Models\User
class for our case:
After we create a new resource we should tell laravel to bind to our resource class rather, then to kit's one.
Add given code row into extendsCoreKitBinds
function in AppServiceProvider
:
After that manipulations, any UserResource
response in CoreKit actions will use your class rather, then core one.
Translation text
- Your email address is not verified.
- You should specify at least one role.
- This role does not exist, or you are trying to use deprecated role for your access.
- Slug field is required.
- Slug should be unique.
- Role name is required.
- You can't create a role without permissions.
- Given permission is not exists in our db.
- Name field is required.
- Name length should be less than 255 chars.
- Name should be unique.
- Is active flag is required.
- Flag value should be boolean.
All versions of laravel-core-kit with dependencies
laravel/framework Version ^10.0
devtools-marvellous/laravel-core-auth Version ^2.1.8
devtools-marvellous/postman-documentation Version ^1.2.12