| Total Complexity | 3 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class Redirect extends Model |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Allow these attributes to be filled. |
||
| 11 | * |
||
| 12 | * @var array |
||
| 13 | */ |
||
| 14 | protected $fillable = [ |
||
| 15 | 'hash', |
||
| 16 | 'redirect_to', |
||
| 17 | ]; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * The url attribute of a particular. |
||
| 21 | * |
||
| 22 | * @var array |
||
| 23 | */ |
||
| 24 | protected $appends = [ |
||
| 25 | 'url' |
||
| 26 | ]; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Hide unnecessary or private fields. |
||
| 30 | * |
||
| 31 | * @return array |
||
| 32 | */ |
||
| 33 | protected $hidden = [ |
||
| 34 | 'created_at', |
||
| 35 | 'updated_at' |
||
| 36 | ]; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Get the url attribute. |
||
| 40 | * |
||
| 41 | * @return void |
||
| 42 | */ |
||
| 43 | 1 | public function getUrlAttribute() |
|
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Creates an absolutely unique hash for a given url. |
||
| 50 | * |
||
| 51 | * @return void |
||
| 52 | */ |
||
| 53 | 1 | public static function createUnique($url) |
|
| 64 |