laravel-smart
laravel-smart copied to clipboard
Idea: timestamps()
Like original Laravel migration files. Something like this would be usefull:
<?php
namespace App;
use Deiucanta\Smart\Field;
use Deiucanta\Smart\Model;
class Product extends Model
{
public function fields()
{
return [
Field::make('id')->increments(),
Field::make('titulo')->text(),
Field::timestamps() // or some fancy method name
];
}
}
I like this idea :) We need a special field type that can generate one or more fields behind the scenes.
The same issue is with rememberToken()
. That is just a "type" but without name. Also, there is morphs()
which generates two fields instead of one.
I'll put this on the roadmap! Thanks @robsontenorio