-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
131 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<?php | ||
|
||
namespace App\Nova; | ||
|
||
use Illuminate\Http\Request; | ||
use Laravel\Nova\Fields\BelongsTo; | ||
use Laravel\Nova\Fields\Code; | ||
use Laravel\Nova\Fields\DateTime; | ||
use Laravel\Nova\Fields\HasOneThrough; | ||
use Laravel\Nova\Fields\ID; | ||
use Laravel\Nova\Http\Requests\NovaRequest; | ||
|
||
class Response extends Resource | ||
{ | ||
/** | ||
* The model the resource corresponds to. | ||
* | ||
* @var class-string<\App\Response> | ||
*/ | ||
public static $model = \App\Response::class; | ||
|
||
/** | ||
* The single value that should be used to represent the resource when being displayed. | ||
* | ||
* @var string | ||
*/ | ||
public static $title = 'id'; | ||
|
||
/** | ||
* The columns that should be searched. | ||
* | ||
* @var array | ||
*/ | ||
public static $search = [ | ||
'id', | ||
]; | ||
|
||
/** | ||
* Get the fields displayed by the resource. | ||
* | ||
* @return array | ||
*/ | ||
public function fields(NovaRequest $request) | ||
{ | ||
return [ | ||
ID::make()->sortable(), | ||
BelongsTo::make('Session')->searchable(), | ||
// BelongsTo::make('Question'), | ||
HasOneThrough::make('Question', 'session', 'App\Nova\Question'), | ||
BelongsTo::make('User')->searchable(), | ||
Code::make('Response Info')->json(), | ||
DateTime::make('Created At'), | ||
DateTime::make('Updated At'), | ||
DateTime::make('Deleted At'), | ||
]; | ||
} | ||
|
||
/** | ||
* Get the cards available for the request. | ||
* | ||
* @return array | ||
*/ | ||
public function cards(NovaRequest $request) | ||
{ | ||
return []; | ||
} | ||
|
||
/** | ||
* Get the filters available for the resource. | ||
* | ||
* @return array | ||
*/ | ||
public function filters(NovaRequest $request) | ||
{ | ||
return []; | ||
} | ||
|
||
/** | ||
* Get the lenses available for the resource. | ||
* | ||
* @return array | ||
*/ | ||
public function lenses(NovaRequest $request) | ||
{ | ||
return []; | ||
} | ||
|
||
/** | ||
* Get the actions available for the resource. | ||
* | ||
* @return array | ||
*/ | ||
public function actions(NovaRequest $request) | ||
{ | ||
return []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters