%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/Address.php |
<?php namespace App\Nova; use Illuminate\Http\Request; use Laravel\Nova\Fields\ID; use Laravel\Nova\Fields\Text; use Laravel\Nova\Fields\BelongsTo; use Laravel\Nova\Http\Requests\NovaRequest; class Address extends Resource { /** * The model the resource corresponds to. * * @var string */ public static $model = \App\Models\UserAddress::class; /** * The logical group associated with the resource. * * @var string */ public static $group = 'Authentication'; /** * Get the value that should be displayed to represent the resource. * * @return string */ public function title() { return $this->formatted; } /** * Get the search result subtitle for the resource. * * @return string */ public function subtitle() { return "User: {$this->user->full_name}"; } /** * The columns that should be searched. * * @var array */ public static $search = [ 'id', 'address', 'town_city', 'postcode', 'lat', 'lng', 'address_type' ]; /** * 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'), 'id')->sortable(), BelongsTo::make('User')->sortable(), Text::make('Address') ->rules('required') ->sortable(), Text::make('Town City') ->rules('required') ->sortable(), Text::make('Postcode') ->rules('required') ->sortable(), Text::make('Lat') ->hideFromIndex() ->sortable(), Text::make('Lng') ->hideFromIndex() ->sortable(), ]; } /** * 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 []; } }