Move models to their own subdirectory
This commit is contained in:
parent
2c5b0f3ab5
commit
2a0d188313
67 changed files with 82 additions and 86 deletions
40
app/Models/Bookmark.php
Normal file
40
app/Models/Bookmark.php
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Bookmark extends Model
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = ['url', 'name', 'content'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'syndicates' => 'array',
|
||||
];
|
||||
|
||||
/**
|
||||
* The tags that belong to the bookmark.
|
||||
*/
|
||||
public function tags()
|
||||
{
|
||||
return $this->belongsToMany('App\Models\Tag');
|
||||
}
|
||||
|
||||
/**
|
||||
* The full url of a bookmark.
|
||||
*/
|
||||
public function getLongurlAttribute()
|
||||
{
|
||||
return config('app.url') . '/bookmarks/' . $this->id;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue