1. Go to this page and download the library: Download rapid/laplus library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rapid / laplus example snippets
public function present()
{
$this->id();
$this->text('title');
$this->string('password')->cast('hashed')->hidden();
$this->belongsTo(Artist::class)->cascadeOnDelete();
}
class Blog extends Model
{
use HasPresent;
use HasSlug; // Will extend the 'slug' column
public function present(Present $present)
{
$present->id();
$present->string('title');
$present->belongsTo(Category::class);
$present->enum('status', Status::class);
$present->yield();
$present->timestamps();
}
}
class UserLabelTranslator extends LabelTranslator
{
public function gender(bool $emoji = false)
{
return $this->value?->toString($emoji); // Returns gender name or null
}
}
class User extends Model
{
use HasPresent;
use HasLabels;
protected function present(Present $present)
{
$present->id();
$present->string('name');
}
#[IsRelation]
public function avatars()
{
return $this->hasMany(Avatar::class);
}
public function getFirstName() : string
{
return Str::before($this->name, ' ');
}
}
/**
* @Guide
* @property int $id
* @property string $name
* @property Collection<int, Avatar> $avatars
* @property string $name_label
* @property string name_label()
* @property string $first_name
* @EndGuide
*/
class User extends Model
shell
php artisan vendor:publish --tag=laplus
shell
php artisan dev:migrate --guide
shell
php artisan deploy:migrate
shell
php artisan make:model-laplus Name
shell
php artisan make:model-laplus --present Name
shell
php artisan dev:migration
shell
php artisan dev:migrate
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.