BookStack/app/Book.php

28 lines
404 B
PHP
Raw Normal View History

2015-07-12 15:01:42 -04:00
<?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';
}
2015-07-12 16:31:15 -04:00
public function pages()
{
return $this->hasMany('Oxbow\Page');
}
2015-07-12 15:01:42 -04:00
}