| 2 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
namespace App\Models;
|
|
|
4 |
|
|
|
5 |
use Illuminate\Database\Eloquent\Model;
|
|
|
6 |
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
7 |
|
| 415 |
lars |
8 |
/**
|
|
|
9 |
* App\Models\Module
|
|
|
10 |
*
|
|
|
11 |
* @property int $id
|
|
|
12 |
* @property string $name
|
|
|
13 |
* @property string $interner_name
|
|
|
14 |
* @property int|null $rang
|
|
|
15 |
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Tool> $tool
|
|
|
16 |
* @property-read int|null $tool_count
|
|
|
17 |
* @method static \Illuminate\Database\Eloquent\Builder|Module newModelQuery()
|
|
|
18 |
* @method static \Illuminate\Database\Eloquent\Builder|Module newQuery()
|
|
|
19 |
* @method static \Illuminate\Database\Eloquent\Builder|Module query()
|
|
|
20 |
* @method static \Illuminate\Database\Eloquent\Builder|Module whereId($value)
|
|
|
21 |
* @method static \Illuminate\Database\Eloquent\Builder|Module whereInternerName($value)
|
|
|
22 |
* @method static \Illuminate\Database\Eloquent\Builder|Module whereName($value)
|
|
|
23 |
* @method static \Illuminate\Database\Eloquent\Builder|Module whereRang($value)
|
|
|
24 |
* @mixin \Eloquent
|
|
|
25 |
*/
|
|
|
26 |
class Module extends Model
|
| 2 |
lars |
27 |
{
|
|
|
28 |
protected $connection = "cms";
|
|
|
29 |
|
|
|
30 |
public function tool(): HasMany
|
|
|
31 |
{
|
|
|
32 |
return $this->hasMany( Tool::class )->where( 'hidden', '=', 'false' )->orderBy( 'tools.rang' );
|
|
|
33 |
}
|
|
|
34 |
}
|