| 1 | <?php |
||
| 21 | class ShortLink extends Model |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * The "type" of the auto-incrementing ID. |
||
| 25 | * |
||
| 26 | * @var string |
||
| 27 | */ |
||
| 28 | protected $keyType = 'string'; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * The table name that has been migrated. |
||
| 32 | * |
||
| 33 | * @var array |
||
| 34 | */ |
||
| 35 | protected $table = 'short_links'; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * The attributes that are mass assignable. |
||
| 39 | * |
||
| 40 | * @var array |
||
| 41 | */ |
||
| 42 | protected $fillable = [ |
||
| 43 | 'id', |
||
| 44 | 'url', |
||
| 45 | 'not_before', |
||
| 46 | 'expire_at', |
||
| 47 | 'enabled', |
||
| 48 | ]; |
||
| 49 | |||
| 50 | /** |
||
| 51 | * The attributes that should be cast to native types. |
||
| 52 | * |
||
| 53 | * @var array |
||
| 54 | */ |
||
| 55 | protected $casts = [ |
||
| 56 | 'not_before' => 'datetime', |
||
| 57 | 'expire_at' => 'datetime', |
||
| 58 | ]; |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Generate short link url using route |
||
| 62 | * |
||
| 63 | * @return string |
||
| 64 | */ |
||
| 65 | public function getShortUrlAttribute() { |
||
| 68 | } |
||
| 69 |