dev-think-one /
laravel-periodic-notice
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace PeriodicNotice\Models; |
||||
| 4 | |||||
| 5 | use Illuminate\Database\Eloquent\Builder; |
||||
| 6 | use Illuminate\Database\Eloquent\Factories\HasFactory; |
||||
| 7 | use Illuminate\Database\Eloquent\Model; |
||||
| 8 | use Illuminate\Database\Eloquent\Relations\MorphTo; |
||||
| 9 | use PeriodicNotice\Factories\PeriodicSentEntryFactory; |
||||
| 10 | |||||
| 11 | /** |
||||
| 12 | * @property \JsonFieldCast\Json\SimpleJsonField $meta |
||||
| 13 | */ |
||||
| 14 | class PeriodicSentEntry extends Model |
||||
| 15 | { |
||||
| 16 | use HasFactory; |
||||
| 17 | |||||
| 18 | protected $guarded = []; |
||||
| 19 | |||||
| 20 | protected $casts = [ |
||||
| 21 | 'meta' => \JsonFieldCast\Casts\SimpleJsonField::class, |
||||
| 22 | ]; |
||||
| 23 | |||||
| 24 | 4 | public function getTable(): string |
|||
| 25 | { |
||||
| 26 | 4 | return config('periodic-notice.tables.periodic_sent_entries'); |
|||
| 27 | } |
||||
| 28 | |||||
| 29 | 2 | public function receiver(): MorphTo |
|||
| 30 | { |
||||
| 31 | 2 | return $this->morphTo(); |
|||
| 32 | } |
||||
| 33 | |||||
| 34 | 2 | public function sendable(): MorphTo |
|||
| 35 | { |
||||
| 36 | 2 | return $this->morphTo(); |
|||
| 37 | } |
||||
| 38 | |||||
| 39 | 3 | public function scopeGroup(Builder $query, string|array $group) |
|||
| 40 | { |
||||
| 41 | 3 | if (is_array($group)) { |
|||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||||
| 42 | 1 | return $query->whereIn('group', $group); |
|||
| 43 | } |
||||
| 44 | |||||
| 45 | 3 | return $query->where('group', '=', $group); |
|||
| 46 | } |
||||
| 47 | |||||
| 48 | 1 | public static function factory(...$parameters): PeriodicSentEntryFactory |
|||
|
0 ignored issues
–
show
The parameter
$parameters 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. Loading history...
|
|||||
| 49 | { |
||||
| 50 | 1 | return new PeriodicSentEntryFactory(); |
|||
| 51 | } |
||||
| 52 | } |
||||
| 53 |