115 lines
2.7 KiB
PHP
115 lines
2.7 KiB
PHP
<?php
|
|
|
|
namespace App\Nova;
|
|
|
|
use App\Nova\Actions\AutoLogin;
|
|
use App\Nova\Actions\Connexion;
|
|
use App\Nova\Actions\Webmail;
|
|
use App\Nova\Filters\EnableFilter;
|
|
use Illuminate\Http\Request;
|
|
use Laravel\Nova\Fields\ID;
|
|
use Laravel\Nova\Fields\Password;
|
|
use Laravel\Nova\Fields\Text;
|
|
use Laravel\Nova\Fields\Textarea;
|
|
use Laravel\Nova\Fields\Boolean;
|
|
use Laravel\Nova\Http\Requests\NovaRequest;
|
|
|
|
class Account extends Resource
|
|
{
|
|
/**
|
|
* The model the resource corresponds to.
|
|
*
|
|
* @var class-string<\App\Models\Account>
|
|
*/
|
|
public static $model = \App\Models\Account::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.
|
|
*
|
|
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
|
|
* @return array
|
|
*/
|
|
public function fields(NovaRequest $request)
|
|
{
|
|
return [
|
|
ID::make()->sortable(),
|
|
Boolean::make('Enable'),
|
|
Text::make('Name'),
|
|
Text::make('Password'),
|
|
Text::make('Rambler Email'),
|
|
Text::make('Rambler Password')->hideFromIndex(),
|
|
Text::make('Auth Token')->hideFromIndex(),
|
|
Text::make('Oauth Token')->hideFromIndex(),
|
|
Text::make('Oauth Token Secret')->hideFromIndex(),
|
|
Text::make('Known Device Token')->hideFromIndex(),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Get the cards available for the request.
|
|
*
|
|
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
|
|
* @return array
|
|
*/
|
|
public function cards(NovaRequest $request)
|
|
{
|
|
return [];
|
|
}
|
|
|
|
/**
|
|
* Get the filters available for the resource.
|
|
*
|
|
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
|
|
* @return array
|
|
*/
|
|
public function filters(NovaRequest $request)
|
|
{
|
|
return [
|
|
new EnableFilter(),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Get the lenses available for the resource.
|
|
*
|
|
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
|
|
* @return array
|
|
*/
|
|
public function lenses(NovaRequest $request)
|
|
{
|
|
return [];
|
|
}
|
|
|
|
/**
|
|
* Get the actions available for the resource.
|
|
*
|
|
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
|
|
* @return array
|
|
*/
|
|
public function actions(NovaRequest $request)
|
|
{
|
|
return [
|
|
Connexion::make(),
|
|
AutoLogin::make(),
|
|
Webmail::make(),
|
|
];
|
|
}
|
|
}
|