mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
exceptOnForms for createdBy
This commit is contained in:
@@ -80,7 +80,7 @@ class BitcoinEvent extends Resource
|
||||
->searchable(),
|
||||
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)
|
||||
->onlyOnIndex(),
|
||||
->exceptOnForms(),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@@ -125,7 +125,8 @@ class BookCase extends Resource
|
||||
|
||||
MorphMany::make(__('Comments'), 'comments', Comment::class),
|
||||
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)->onlyOnIndex(),
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)
|
||||
->exceptOnForms(),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ class City extends Resource
|
||||
HasMany::make(__('Meetups'), 'meetups', Meetup::class),
|
||||
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)
|
||||
->onlyOnIndex(),
|
||||
->exceptOnForms(),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@@ -109,7 +109,8 @@ class Course extends Resource
|
||||
BelongsToMany::make(__('Categories'), 'categories', Category::class)
|
||||
->onlyOnDetail(),
|
||||
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)->onlyOnIndex(),
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)
|
||||
->exceptOnForms(),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@@ -90,7 +90,8 @@ class CourseEvent extends Resource
|
||||
BelongsTo::make(__('Venue'), 'venue', Venue::class)
|
||||
->searchable(),
|
||||
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)->onlyOnIndex(),
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)
|
||||
->exceptOnForms(),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@@ -112,7 +112,8 @@ class Episode extends Resource
|
||||
BelongsTo::make(__('Podcast'), 'podcast', Podcast::class)
|
||||
->readonly(),
|
||||
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)->onlyOnIndex(),
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)
|
||||
->exceptOnForms(),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@@ -97,7 +97,8 @@ class Lecturer extends Resource
|
||||
|
||||
BelongsTo::make('Team'),
|
||||
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)->onlyOnIndex(),
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)
|
||||
->exceptOnForms(),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@@ -76,7 +76,8 @@ class Library extends Resource
|
||||
|
||||
BelongsToMany::make('Library Items'),
|
||||
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)->onlyOnIndex(),
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)
|
||||
->exceptOnForms(),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@@ -31,12 +31,6 @@ class LibraryItem extends Resource
|
||||
* @var string
|
||||
*/
|
||||
public static $title = 'name';
|
||||
|
||||
public static function label()
|
||||
{
|
||||
return __('Library Item');
|
||||
}
|
||||
|
||||
/**
|
||||
* The columns that should be searched.
|
||||
* @var array
|
||||
@@ -46,6 +40,11 @@ class LibraryItem extends Resource
|
||||
'name',
|
||||
];
|
||||
|
||||
public static function label()
|
||||
{
|
||||
return __('Library Item');
|
||||
}
|
||||
|
||||
public static function afterCreate(NovaRequest $request, Model $model)
|
||||
{
|
||||
\App\Models\User::find(1)
|
||||
@@ -93,7 +92,8 @@ class LibraryItem extends Resource
|
||||
|
||||
Select::make(__('Type'))
|
||||
->options(
|
||||
Options::forEnum(LibraryItemType::class)->toArray()
|
||||
Options::forEnum(LibraryItemType::class)
|
||||
->toArray()
|
||||
)
|
||||
->rules('required', 'string'),
|
||||
|
||||
@@ -103,11 +103,14 @@ class LibraryItem extends Resource
|
||||
|
||||
BelongsTo::make(__('Lecturer/Content Creator'), 'lecturer', Lecturer::class),
|
||||
|
||||
BelongsTo::make(__('Episode'), 'episode', Episode::class)->nullable(),
|
||||
BelongsTo::make(__('Episode'), 'episode', Episode::class)
|
||||
->nullable()
|
||||
->exceptOnForms(),
|
||||
|
||||
BelongsToMany::make(__('Library'), 'libraries', Library::class),
|
||||
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)->onlyOnIndex(),
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)
|
||||
->exceptOnForms(),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@@ -68,7 +68,8 @@ class Meetup extends Resource
|
||||
|
||||
BelongsTo::make(__('City'), 'city', City::class)->searchable(),
|
||||
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)->onlyOnIndex(),
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)
|
||||
->exceptOnForms(),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@@ -74,7 +74,8 @@ class MeetupEvent extends Resource
|
||||
BelongsTo::make('Meetup')
|
||||
->searchable(),
|
||||
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)->onlyOnIndex(),
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)
|
||||
->exceptOnForms(),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ class OrangePill extends Resource
|
||||
->rules('required', 'integer'),
|
||||
|
||||
BelongsTo::make('User'),
|
||||
|
||||
BelongsTo::make('BookCase'),
|
||||
|
||||
];
|
||||
|
||||
@@ -94,7 +94,8 @@ class Podcast extends Resource
|
||||
|
||||
HasMany::make(__('Episodes'), 'episodes', Episode::class),
|
||||
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)->onlyOnIndex(),
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)
|
||||
->exceptOnForms(),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ class Registration extends Resource
|
||||
->rules('required'),
|
||||
|
||||
BelongsTo::make('Course Event', 'courseEvent'),
|
||||
|
||||
BelongsTo::make('Participant'),
|
||||
|
||||
];
|
||||
|
||||
@@ -75,7 +75,8 @@ class Venue extends Resource
|
||||
|
||||
BelongsTo::make(__('City'), 'city', City::class),
|
||||
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)->onlyOnIndex(),
|
||||
BelongsTo::make(__('Created By'), 'createdBy', User::class)
|
||||
->exceptOnForms(),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user