Skip to content

Instantly share code, notes, and snippets.

@mattwells
Created February 12, 2015 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattwells/cecf49b3ab92ed275c2d to your computer and use it in GitHub Desktop.
Save mattwells/cecf49b3ab92ed275c2d to your computer and use it in GitHub Desktop.
Laravel 5 Eloquent Casts
<?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