<?php
// use ...
class RegisterCompany extends RegisterTenant
{
public static function getLabel(): string
{
return 'Create company';
}
/**
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function form(Form $form): Form
{
return $form
->schema([
Select::make('type')
->options([
'General' => 'General',
'Simplified' => 'Simplified',
'Patent' => 'Patent'
]),
TextInput::make('name'),
TextInput::make('short_name'),
]);
}
protected function handleRegistration(array $data): Company
{
$company = Company::create($data);
$company->members()->attach(auth()->user());
return $company;
}
}
<?php
// use ...
class RegisterCompany extends RegisterTenant
{
public static function getLabel(): string
{
return 'Create company';
}
/**
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function form(Form $form): Form
{
return $form
->schema([
Select::make('type')
->options([
'General' => 'General',
'Simplified' => 'Simplified',
'Patent' => 'Patent'
]),
TextInput::make('name'),
TextInput::make('short_name'),
]);
}
protected function handleRegistration(array $data): Company
{
$company = Company::create($data);
$company->members()->attach(auth()->user());
return $company;
}
}