lecturer v4v

This commit is contained in:
Benjamin Takats
2023-01-24 15:07:18 +01:00
parent 4d6cce5dab
commit 6b2ea031a9
4 changed files with 77 additions and 6 deletions

View File

@@ -88,6 +88,17 @@ class Lecturer extends Resource
Text::make('Name')
->rules('required', 'string'),
Text::make(__('Lightning Address'), 'lightning_address')
->help(__('for example xy@getalby.com'))
->rules('nullable', 'string'),
Text::make(__('LNURL'), 'lnurl')
->help(__('starts with: lnurl1dp68gurn8gh....'))
->rules('nullable', 'string'),
Text::make(__('Node Id'), 'node_id')
->rules('nullable', 'string'),
Text::make('Twitter username', 'twitter_username')
->help(__('Without @'))
->rules('nullable', 'string'),

View File

@@ -4,11 +4,9 @@ namespace App\Nova;
use App\Notifications\ModelCreatedNotification;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Validation\Rules;
use Laravel\Nova\Fields\Gravatar;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\MorphToMany;
use Laravel\Nova\Fields\Password;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
@@ -69,16 +67,27 @@ class User extends Resource
->sortable()
->rules('required', 'max:255'),
Text::make(__('Lightning Address'), 'lightning_address')
->help(__('for example xy@getalby.com'))
->rules('nullable', 'string'),
Text::make(__('LNURL'), 'lnurl')
->help(__('starts with: lnurl1dp68gurn8gh....'))
->rules('nullable', 'string'),
Text::make(__('Node Id'), 'node_id')
->rules('nullable', 'string'),
Text::make('Email')
->sortable()
->rules('required', 'email', 'max:254')
->creationRules('unique:users,email')
->updateRules('unique:users,email,{{resourceId}}'),
Password::make('Password')
->onlyOnForms()
->creationRules('required', Rules\Password::defaults())
->updateRules('nullable', Rules\Password::defaults()),
// Password::make('Password')
// ->onlyOnForms()
// ->creationRules('required', Rules\Password::defaults())
// ->updateRules('nullable', Rules\Password::defaults()),
MorphToMany::make('Roles', 'roles', \Itsmejoshua\Novaspatiepermissions\Role::class),