%PDF- %PDF-
Direktori : /home/forge/api-takeaseat.eco-n-tech.co.uk/app/Nova/ |
Current File : //home/forge/api-takeaseat.eco-n-tech.co.uk/app/Nova/Therapist.php |
<?php namespace App\Nova; use Illuminate\Http\Request; use Laravel\Nova\Fields\ID; use Laravel\Nova\Fields\Heading; use Laravel\Nova\Fields\BelongsTo; use Laravel\Nova\Fields\BelongsToMany; use Laravel\Nova\Fields\HasMany; use Laravel\Nova\Fields\DateTime; use Laravel\Nova\Fields\HasOne; use Laravel\Nova\Fields\Trix; use Laravel\Nova\Fields\Select; use Laravel\Nova\Fields\Boolean; use Laravel\Nova\Http\Requests\NovaRequest; class Therapist extends Resource { /** * The model the resource corresponds to. * * @var string */ public static $model = \App\Models\Therapist::class; /** * The logical group associated with the resource. * * @var string */ public static $group = 'Therapists'; /** * The relationships that should be eager loaded on index queries. * * @var array */ public static $with = ['user']; /** * Get the value that should be displayed to represent the resource. * * @return string */ public function title() { return $this->user->full_name; } /** * The columns that should be searched. * * @var array */ public static $search = [ 'id' ]; /** * Get the searchable columns for the resource. * * @return array */ public static function searchableRelations(): array { return [ 'user' => ['first_name', 'last_name'] ]; } /** * Get the searchable columns for the resource. * * @return array */ public static function globallySearchableRelations(): array { return [ 'user' => ['first_name', 'last_name'] ]; } /** * Get the fields displayed by the resource. * * @param \Illuminate\Http\Request $request * @return array */ public function fields(Request $request) { return [ ID::make('ID')->sortable(), BelongsTo::make('User')->sortable() ->searchable() ->showCreateRelationButton(), Heading::make('Content'), Trix::make('About', 'description'), Heading::make('Authorisation'), Boolean::make('Complete', 'is_complete') ->sortable(), Boolean::make('Authorised', 'is_authorised') ->sortable(), DateTime::make('Created', 'created_at')->sortable(), BelongsToMany::make('Specialisms'), BelongsToMany::make('Sessions'), BelongsToMany::make('Tags'), HasMany::make('Qualifications'), HasMany::make('Memberships'), HasOne::make('Insurance'), HasOne::make('Supervisor'), HasMany::make('Questions', 'questions_one', 'App\Nova\QuestionAnswers'), BelongsToMany::make('Clients', 'user', 'App\Nova\User'), ]; } /** * Get the cards available for the request. * * @param \Illuminate\Http\Request $request * @return array */ public function cards(Request $request) { return []; } /** * Get the filters available for the resource. * * @param \Illuminate\Http\Request $request * @return array */ public function filters(Request $request) { return []; } /** * Get the lenses available for the resource. * * @param \Illuminate\Http\Request $request * @return array */ public function lenses(Request $request) { return []; } /** * Get the actions available for the resource. * * @param \Illuminate\Http\Request $request * @return array */ public function actions(Request $request) { return []; } }