Skip to content

v2.0.0

Compare
Choose a tag to compare
@calebporzio calebporzio released this 04 Mar 02:55

Added

  • Made columns nullable by default
  • Added auto-detecting of column types: integer, float, datetime, string
  • Allow for a custom schema with $schema property or getSchema function:
class ModelWithCustomSchema extends Model
{
    use \Sushi\Sushi;

    protected $rows = [[
        'string_int' => '123',
    ]];

    protected $schema = [
        'string_int' => 'integer',
    ];
}

(Now the $model->string_int will be an integer instead of a string)