Created
February 12, 2015 15:49
-
-
Save mattwells/cecf49b3ab92ed275c2d to your computer and use it in GitHub Desktop.
Laravel 5 Eloquent Casts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App; | |
use Illuminate\Database\Eloquent\Model; | |
class User extends Model { | |
// ... | |
/** | |
* The attributes that should be casted to native types. | |
* | |
* @var array | |
*/ | |
protected $casts = [ | |
'id' => 'integer', | |
]; | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment