mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
28 lines
404 B
PHP
28 lines
404 B
PHP
<?php
|
|
|
|
namespace Oxbow;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Book extends Model
|
|
{
|
|
|
|
protected $fillable = ['name', 'description'];
|
|
|
|
public function getUrl()
|
|
{
|
|
return '/books/' . $this->slug;
|
|
}
|
|
|
|
public function getEditUrl()
|
|
{
|
|
return $this->getUrl() . '/edit';
|
|
}
|
|
|
|
public function pages()
|
|
{
|
|
return $this->hasMany('Oxbow\Page');
|
|
}
|
|
|
|
}
|