Answers for "laravel json eloquent"

0

laravel eloquent json type

<?php
//Array & JSON Casting
namespace App;

use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    /**
     * The attributes that should be cast.
     *
     * @var array
     */
    protected $casts = [
        'options' => 'array',
    ];
}
namespace App;

use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    /**
     * The attributes that should be cast.
     *
     * @var array
     */
    protected $casts = [
        'options' => 'array',
    ];
}
Posted by: Guest on August-17-2020
0

laravel json eloquent

protected $casts = [
    'birthday' => 'date:Y-m-d',
    'joined_at' => 'datetime:Y-m-d H:00',
];
Posted by: Guest on August-01-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language