1. Go to this page and download the library: Download milwad/laravel-attributes 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/ */
milwad / laravel-attributes example snippets
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Milwad\LaravelAttributes\Traits\Attributable;
class Product extends Model
{
use HasFactory, Attributable;
}
return [
/*
* Table config
*
* Here it's a config of migrations.
*/
'tables' => [
/*
* Get table name of migration.
*/
'name' => 'attributes',
/*
* Use uuid as primary key.
*/
'uuids' => false, // Also in beta !!!
],
/*
* Model class name for attributes table.
*/
'attributes_model' => \Milwad\LaravelAttributes\Attribute::class,
];