Skip to content

Instantly share code, notes, and snippets.

@herusdianto
Last active August 29, 2015 14:21
Show Gist options
  • Save herusdianto/7c8a641724b91aee00b0 to your computer and use it in GitHub Desktop.
Save herusdianto/7c8a641724b91aee00b0 to your computer and use it in GitHub Desktop.
Laravel mutate another column to carbon object
<?php namespace App;
use Illuminate\Auth\Authenticatable;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
use Illuminate\Database\Eloquent\Model;
/**
* Class User
*
* @package App
*/
class User extends Model implements AuthenticatableContract, CanResetPasswordContract {
use Authenticatable, CanResetPassword;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'users';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['name', 'email', 'password'];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = ['password', 'remember_token'];
/**
* The attributes that should be mutated to dates.
*
* @var array
*/
protected $dates = ['last_login'];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment