feat: Integrate Swindon\FilamentHashids trait into multiple models for enhanced ID encoding
This commit is contained in:
parent
0dad32aa12
commit
24c95ceb87
@ -9,10 +9,11 @@
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class Announcement extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
use HasFactory, HasHashid, SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -5,10 +5,11 @@
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class AnnouncementMedia extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasFactory, HasHashid;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -9,10 +9,11 @@
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class Category extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
use HasFactory, HasHashid, SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -4,9 +4,12 @@
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class CategoryNews extends Model
|
||||
{
|
||||
use HasHashid;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
public function category(): BelongsToMany
|
||||
|
||||
@ -9,10 +9,11 @@
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class Classification extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
use HasFactory, HasHashid, SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -11,10 +11,11 @@
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Spatie\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class Company extends Model implements HasMedia
|
||||
{
|
||||
use HasFactory, InteractsWithMedia, SoftDeletes;
|
||||
use HasFactory, HasHashid, InteractsWithMedia, SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -4,9 +4,12 @@
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class Contact extends Model
|
||||
{
|
||||
use HasHashid;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
|
||||
@ -9,10 +9,11 @@
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Spatie\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class ContentRecap extends Model implements HasMedia
|
||||
{
|
||||
use HasFactory, InteractsWithMedia, SoftDeletes;
|
||||
use HasFactory, HasHashid, InteractsWithMedia, SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -14,10 +14,11 @@
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Spatie\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class Cooperation extends Model implements HasMedia
|
||||
{
|
||||
use HasFactory, InteractsWithMedia, SoftDeletes;
|
||||
use HasFactory, HasHashid, InteractsWithMedia, SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -12,10 +12,11 @@
|
||||
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||
use Spatie\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class CooperationMedia extends Pivot implements HasMedia
|
||||
{
|
||||
use HasFactory, InteractsWithMedia;
|
||||
use HasFactory, HasHashid, InteractsWithMedia;
|
||||
|
||||
protected $table = 'cooperation_media';
|
||||
|
||||
|
||||
@ -7,10 +7,11 @@
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Spatie\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class CooperationPayment extends Model implements HasMedia
|
||||
{
|
||||
use HasFactory, InteractsWithMedia;
|
||||
use HasFactory, HasHashid, InteractsWithMedia;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -11,10 +11,11 @@
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Spatie\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class CooperationProposal extends Model implements HasMedia
|
||||
{
|
||||
use HasFactory, InteractsWithMedia;
|
||||
use HasFactory, HasHashid, InteractsWithMedia;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -6,10 +6,11 @@
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class Department extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
use HasFactory, HasHashid, SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -7,10 +7,11 @@
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class IssueManagement extends Model
|
||||
{
|
||||
use HasFactory, HasFactory, SoftDeletes;
|
||||
use HasFactory, HasHashid, SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -9,10 +9,11 @@
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Spatie\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class Journalist extends Model implements HasMedia
|
||||
{
|
||||
use HasFactory, InteractsWithMedia, SoftDeletes;
|
||||
use HasFactory, HasHashid, InteractsWithMedia, SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -7,10 +7,11 @@
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class Location extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
use HasFactory, HasHashid, SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -9,10 +9,11 @@
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Spatie\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class MediaMonitoring extends Model implements HasMedia
|
||||
{
|
||||
use HasFactory, InteractsWithMedia, SoftDeletes;
|
||||
use HasFactory, HasHashid, InteractsWithMedia, SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -5,10 +5,11 @@
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class MediaMonitoringTheme extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasFactory, HasHashid;
|
||||
|
||||
protected $table = 'media_monitoring_theme';
|
||||
|
||||
|
||||
@ -7,10 +7,11 @@
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class MediaTaskAssignment extends Pivot
|
||||
{
|
||||
use HasFactory;
|
||||
use HasFactory, HasHashid;
|
||||
|
||||
protected $table = 'media_task_assignment';
|
||||
|
||||
|
||||
@ -15,10 +15,11 @@
|
||||
use Spatie\Sluggable\HasSlug;
|
||||
use Spatie\Sluggable\SlugOptions;
|
||||
use Spatie\Tags\HasTags;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class News extends Model implements HasMedia
|
||||
{
|
||||
use HasFactory, HasSlug, HasTags, InteractsWithMedia, SoftDeletes;
|
||||
use HasFactory, HasHashid, HasSlug, HasTags, InteractsWithMedia, SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -16,10 +16,11 @@
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Spatie\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class PartnerMedia extends Model implements HasMedia
|
||||
{
|
||||
use HasFactory, InteractsWithMedia, SoftDeletes;
|
||||
use HasFactory, HasHashid, InteractsWithMedia, SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -5,10 +5,11 @@
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class RejectionReason extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasFactory, HasHashid;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -10,10 +10,11 @@
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Spatie\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class Report extends Model implements HasMedia
|
||||
{
|
||||
use HasFactory, InteractsWithMedia, SoftDeletes;
|
||||
use HasFactory, HasHashid, InteractsWithMedia, SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -9,10 +9,11 @@
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class SubClassification extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
use HasFactory, HasHashid, SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -7,10 +7,11 @@
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class SubLocation extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
use HasFactory, HasHashid, SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -8,10 +8,11 @@
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class TaskAssignment extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasFactory, HasHashid;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -9,10 +9,11 @@
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class Theme extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
use HasFactory, HasHashid, SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -16,10 +16,11 @@
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class User extends Authenticatable implements FilamentUser, MustVerifyEmail
|
||||
{
|
||||
use HasFactory, HasRoles, Notifiable, SoftDeletes;
|
||||
use HasFactory, HasHashid, HasRoles, Notifiable, SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -9,10 +9,11 @@
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class VerificationRequest extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
use HasHashid, SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@ -8,10 +8,11 @@
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Swindon\FilamentHashids\Traits\HasHashid;
|
||||
|
||||
class VerificationReview extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
use HasHashid, SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user