-
-
Notifications
You must be signed in to change notification settings - Fork 364
/
Category.php
executable file
·50 lines (44 loc) · 986 Bytes
/
Category.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
48
49
50
<?php
/**
* NOTICE OF LICENSE
*
* UNIT3D is open-sourced software licensed under the GNU General Public License v3.0
* The details is bundled with this project in the file LICENSE.txt.
*
* @project UNIT3D
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
* @author HDVinnie
*/
namespace App;
use Illuminate\Database\Eloquent\Model;
class Category extends Model
{
public $timestamps = false;
/**
* Validation rules
*
*/
public $rules = [
'name' => 'required|unique:categories',
'slug' => 'required|unique:categories',
'icon' => 'required',
'meta' => 'required'
];
/**
* Has many torrents
*
*
*/
public function torrents()
{
return $this->hasMany(\App\Torrent::class);
}
/**
* Has many requests
*
*/
public function requests()
{
return $this->hasMany(\App\Requests::class);
}
}