1 | <?php |
||||||
2 | |||||||
3 | namespace Fomvasss\Variable\Models; |
||||||
4 | |||||||
5 | use Illuminate\Database\Eloquent\Model; |
||||||
6 | |||||||
7 | class Variable extends Model |
||||||
8 | { |
||||||
9 | public $table = 'variables'; |
||||||
10 | |||||||
11 | public $timestamps = false; |
||||||
12 | |||||||
13 | public $guarded = ['id']; |
||||||
14 | |||||||
15 | public function __construct(array $attributes = []) |
||||||
16 | { |
||||||
17 | parent::__construct($attributes); |
||||||
18 | |||||||
19 | $this->setTable(config('variables.table_name')); |
||||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||||
20 | } |
||||||
21 | |||||||
22 | protected static function booted() |
||||||
23 | { |
||||||
24 | static::saved(function ($model) { |
||||||
0 ignored issues
–
show
The parameter
$model is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
25 | if (config('variables.cache.autoclear')) { |
||||||
0 ignored issues
–
show
The function
config was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
26 | app(\Fomvasss\Variable\VariableManagerContract::class)->cacheClear(); |
||||||
0 ignored issues
–
show
The function
app was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
27 | } |
||||||
28 | }); |
||||||
29 | } |
||||||
30 | |||||||
31 | public function byLangcode($query, ?string $langcode = null) |
||||||
32 | { |
||||||
33 | return $query->when($langcode, function ($q) use ($langcode) { |
||||||
34 | $q->where('langcode', $langcode); |
||||||
35 | }); |
||||||
36 | } |
||||||
37 | } |
||||||
38 |