BookStack/app/Page.php

21 lines
346 B
PHP
Raw Normal View History

2015-07-12 19:01:42 +00:00
<?php
namespace Oxbow;
use Illuminate\Database\Eloquent\Model;
class Page extends Model
{
2015-07-12 20:31:15 +00:00
protected $fillable = ['name', 'html', 'priority'];
public function book()
{
return $this->belongsTo('Oxbow\Book');
}
public function getUrl()
{
return '/books/' . $this->book->slug . '/' . $this->slug;
}
2015-07-12 19:01:42 +00:00
}