1. Go to this page and download the library: Download based/laravel-fluent 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/ */
class Product extends Model
{
use Fluent;
public Collection $features;
public float $price;
public int $available;
}
class User extends Model
{
use Fluent;
}
class Order extends Model
{
use Fluent;
public int $amount;
public Carbon $expires_at;
#[AsDecimal(2)]
public float $total;
#[Cast('encrypted:array')]
public array $payload;
}
class Product extends Model
{
use Fluent;
#[Relation]
public Collection $features;
public Category $category;
public function features(): HasMany
{
return $this->hasMany(Feature::class);
}
public function category(): BelongsTo
{
return $this->belongsTo(Category::class);
}
}
class Product extends Model
{
use Fluent;
#[HasMany(Feature::class)]
public Collection $features;
#[BelongsTo]
public Category $category;
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.