mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-02-07 03:58:52 -06:00
- renamed models/functions and more to avoid conflict with `App\Http\Requests` which will be used to refactor all HTTP Validation rules into dedicated form requests
50 lines
934 B
PHP
50 lines
934 B
PHP
<?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://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
|
|
* @author HDVinnie
|
|
*/
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Type extends Model
|
|
{
|
|
public $timestamps = false;
|
|
|
|
/**
|
|
* Validation rules
|
|
*
|
|
*/
|
|
public $rules = [
|
|
'name' => 'required',
|
|
'slug' => 'required',
|
|
'position' => 'required'
|
|
];
|
|
|
|
/**
|
|
* Has many torrents
|
|
*
|
|
*
|
|
*/
|
|
public function torrents()
|
|
{
|
|
return $this->hasMany(\App\Torrent::class);
|
|
}
|
|
|
|
/**
|
|
* Has many requests
|
|
*
|
|
*/
|
|
public function requests()
|
|
{
|
|
return $this->hasMany(\App\TorrentRequest::class);
|
|
}
|
|
}
|