TALL-forms
  • TALL-forms
  • Installation
    • Quickstart: Artisan cmd
    • Manual installation
      • Package
      • Translations
      • Css & Theme
      • Javascript
      • Tailwind
      • Laravel Mix
      • Wrapper view
      • Laravel Jetstream/Breeze
  • Upgrade v7 to v8
    • Configuration changes
    • Component & Field changes
    • Blade view changes
    • Notification changes
    • Styling changes
  • Concept
    • Configuration
    • Validation
    • Styling
    • Icons
    • Javascript
    • Layout vs Wrapper
    • Model binding
    • Manually saving data
    • Extend Blade Components
  • Create Forms
    • Form Data
    • Form Types
      • Standard form
      • As modal
      • Without buttons
      • Fields only
      • Headless
    • Form attributes
    • Form buttons
    • Form slots
    • Form methods
    • Lifecycle hooks
    • Render a form
    • Mass generate
  • Fields
    • Declaration
    • Labels
    • Field Slots
    • Field methods
    • Custom field attributes
    • Conditional field
    • Custom view
    • Custom field
    • Custom Livewire component
    • Relations
    • Fields
      • Checkbox
      • Checkboxes
      • FileUpload
      • Honeypot
      • ImageCropper
      • Input
      • Password
      • InputArray
      • KeyVal (array)
      • Radio
      • Range
      • Repeater (array)
      • Search
      • Select & Multiselect
      • Tags
      • TagsSearch
      • Textarea
      • Trix
      • SpatieTags
    • Sponsor Fields
      • More Inputs
      • CKEditor
      • DatePicker
      • Heading
      • Markdown
      • Panels
      • SearchList
      • SelectOptGroup
      • Tabs
      • Trix, file-uploads
  • Blade components
    • Notifications
    • Label wrapper
    • Button
    • Modal blade component
    • Modal form blade component
  • Examples
    • Input examples
    • Array fields example
Powered by GitBook
On this page
  • Refactor Form attributes, move from mount() to formAttr()
  • Component methods changed to protected
  • delete() and onDeleteModel() security risk!
  • Search and replace:
  • Deprecated fields or field methods
  • Changed defaults
  • Changed field methods
  • New field methods/attributes
  • Fixed
  • Validation

Was this helpful?

  1. Upgrade v7 to v8

Component & Field changes

Refactor Form attributes, move from mount() to formAttr()

To protect form attributes from being exposed to frontend, they are now loaded as a Livewire computed property.

Before

public function mount(User $user)
{
    $this->fill([ //you might have used $this->fill([])...
        'wrapWithView' => false,
        'inline' => false,
        'showDelete' => false,
    ]);
    
    $this->formTitle = 'Edit User'; //...or, you set the form attributes separately
    
    $this->mount_form($user);
}

Now

public function mount(User $user)
{   
    $this->mount_form($user);
}

public function formAttr(): array
{
    return [
        'formTitle' => 'Edit User',
        'wrapWithView' => false,
        'inline' => false,
        'showDelete' => false,
    ];
}

Component methods changed to protected

You might get errors from functions that has been changed from public to protected.

Methods that has been changed from public to protected

Comment

onCreateModel

onUpdateModel

onDeleteModel

See special note on this page

fields

saveFoo

beforeFormProperties

afterFormProperties

delete() and onDeleteModel() security risk!

The delete() method is public, which means that it can be called from frontend. You should probably override it to add your desired access control. That is what the onDeleteModel() hook is for. Please override it in your component. (This is nothing new, I just want to emphasize the importance of this method.)

Search and replace:

Field type

Search

Replace with

Comment

Input

Number Color DateInput TimeInput DateTimeLocal Week Month Email Number Password Tel Url

->class(...)

->wrapperClass(...)

class() still exists, but is applied to the input instead of the outmost div.

Input type hidden

(Honeypot)

->class('nosy')

->wrapperClass('nosy')

See previous comment

Deprecated fields or field methods

These methods are still kept in the code, for legacy reasons.

Deprecated

Replace with

Example/Comment

noDefer()

deferEntangle(false)

Use any of the methods,

SpatieTags

Tags or TagsSearch

keyAsAttribute

validationAttr(string)

Changed defaults

Field

Comment

Input, type number

max changed from 100 to infinite

$onKeyDownEnter

Default = "saveAndStay" instead of null.

Changed field methods

Method

Comment

includeExternalScripts(bool $state = true)

Added option to pass true/false

New field methods/attributes

Field

Method/comment

Input

icon(string $name, ?string $class) sfxIcon(string $name, ?string $class)

Add classes to Blade UI Kit icons

Heading

Panel

Tabs

icon(string $name, ?string $class)

Add classes to Blade UI Kit icons

All Fields

wrapperClass(string $classes)

Applied to field component, root div

All Fields

errorClass(string $classes, bool $append = true)

Append to, or replace, default field error class.

All Fields

wire(...)

It is optional to type wire:model, the modifier is enough. Exampel: wire('debounce.750ms')

Most Fields

disabled(bool $state = true)

Fixed

Method

Comment

class(

string $classes,

$append = true

)

$append was always true. Now it either appends to default input class or replaces it.

Validation

PreviousConfiguration changesNextBlade view changes

Last updated 3 years ago

Was this helpful?

read more:

The get_rules() method has changed to follow Livewire standards. If you have overridden it in your components. Please se the page for changes.

Validation
Alpine page