Download the PHP package rapid/laplus without Composer
On this page you can find all versions of the php package rapid/laplus. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laplus
Laplus ➕
Laravel plus+ add presentation for your models
What's Changed In V4
- Command names changed
- New development & production deploy tools
- Removed slug and file columns
- Supports renames and changes a column at the same time
- Supports package resources
- Added travels (read more...)
- Added validation generators (read more...)
Features
1. Migration Generating
Define the structure of your model: columns, indexes, data types, enums, relationships, or even extensibility with traits.
Don't get involved in migrations! Because Laplus has taken responsibility for all migrations, and it builds all migrations by reading your presentations 😎
Read more...
2. Auto Fills
No need to redefine \$fillable, \$cast and $hidden! Defining it in the present specifies everything. So Laplus will autofill these variables. 😉
Read more...
3. IDE Friendly
When all the columns, their types, and their relationships are known, why shouldn't the IDE show them to us?
Laplus introduces all of this to the IDE by generating a neat (and out-of-model) document. 📝
Read more...
4. Travels
Once a version of the project has been deployed, it is almost impossible to change the database.
Travels allow you to make changes to the table records as well as change the table structure. ✈️
In the above example, we are going to remove first_name
and last_name
from the users table
and replace them with full_name
.
The above class is responsible for generating the full_name
value using the previous
data before deleting first_name
and last_name
.
Read more...
Requirements
- Php 8.2 or higher
- Laravel 11.0
Documents
- Installation
- Configuration
- Present
- Dev Utils
- Deploy
- Label
- Guide
- Travel
- Package Development
- Validation Generator
Installation
1- Install the package with composer:
2- Publish configs (Optional)
Run this command to publish configs to config/laplus.php
3- Convert default User model to presentable model (Optional):
-
Add
HasPresent
trait: - Remove
$fillable
,$hidden
andcasts()
values:
Laplus will automatically add this values.
Add below code in User class:
- Move default migration to laplus path:
Find database/migrations/0001_01_01_000000_create_users_table.php
file and move it
into database/migrations/deploy
folder (create it if doesn't exists)
Development Utils
To be able to update your tables during development, you can use the following command:
Read more...
Deployment
When deploying the project to production, you can create the final migrations with the following command:
For greater project safety, you can follow the scenario we have written on the page below.
Read more...
Make model
You can use this command to create a model and a present:
This command will create app/Models/Name.php
with inline presentation.
Read more...
Make model with separately present
You can use this command to create a model with present class:
This command will create app/Models/Name.php
model and app/Presents/NamePresent.php
present.
Read more...
Migrations
Generate Migrations
Run this command to automatically found the updates and generate migrations:
Read more...
Update Database
Following command, run dev:migration
and migrate
at once:
Read more...
Label Translator
Present the model labels:
And use it easily:
Labels always return a string value. If the value is null, it returns
"Undefined"
.
Read more...
Guide Generator
Guide automatically generate the model docblock using the columns, attributes and relationships:
It generates:
Read more...
More Document
More document found in Documents section.