-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathDocument.php
executable file
·47 lines (41 loc) · 997 Bytes
/
Document.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
namespace App\Models;
use App\Docs;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Document extends Model
{
use HasFactory, HasUuids;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'id',
'version',
'file',
'behind',
'current_commit',
'last_commit',
];
/**
* The default values for attributes.
*
* @var array
*/
protected $attributes = [
'version' => Docs::DEFAULT_VERSION,
'behind' => null,
];
/**
* Get the URL to edit the page on GitHub.
*
* @return string The URL to edit the page on GitHub.
*/
public function getEditUrl(): string
{
return sprintf('https://github.com/%s/edit/%s/%s', config('services.github.repos.docs'), $this->version, $this->file);
}
}