Without buttons
requires an Eloquent Model
If you want your buttons elsewhere
Create the form
php artisan make:tall-form UserWithoutButtons --action=no-buttons --model=User<?php
namespace App\Http\Livewire\Forms;
use App\User;
use Tanthammar\TallForms\Input;
use Tanthammar\TallForms\TallFormWithoutButtons;
class UserWithoutButtons extends TallFormWithoutButtons
{
//TODO set your view path.name here
protected string $view = 'livewire.without-buttons';
public function mount(?User $user)
{
$this->mount_form($user);
}
protected function formAttr(): array
{
return [
'formTitle' => "Form without buttons",
];
}
// OPTIONAL method
protected function onCreateModel($validated_data)
{
$this->model = User::create($validated_data);
}
// OPTIONAL method
protected function onUpdateModel($validated_data)
{
$this->model->update($validated_data);
}
protected function fields(): array
{
return [
Input::make('Name')->rules('required|in:Anna'),
Input::make('Email')->type('email')->rules('required|email'),
];
}
}
Create a form view
Create a route view
Create a route
Last updated
Was this helpful?