<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
albinodrought / laravel-fillable-relations example snippets
namespace MyApp\Models;
use Illuminate\Database\Eloquent\Model;
use LaravelFillableRelations\Eloquent\Concerns\HasFillableRelations;
class Foo extends Model
{
use HasFillableRelations;
protected $fillableRelations = ['bar'];
function bar()
{
return $this->hasOne(Bar::class);
}
}
class Bar extends Model
{
use HasFillableRelations;
protected $fillableRelations = ['foos'];
function foos()
{
return $this->hasMany(Foo::class);
}
}