laravel-smart icon indicating copy to clipboard operation
laravel-smart copied to clipboard

Idea: timestamps()

Open robsontenorio opened this issue 6 years ago • 1 comments

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
        ];
    }
}

robsontenorio avatar Aug 28 '18 00:08 robsontenorio

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

deiucanta avatar Aug 28 '18 08:08 deiucanta