BookStack/app/Page.php

21 lines
346 B
PHP
Raw Normal View History

2015-07-12 21:01:42 +02:00
<?php
namespace Oxbow;
use Illuminate\Database\Eloquent\Model;
class Page extends Model
{
2015-07-12 22:31:15 +02: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 21:01:42 +02:00
}