Columns Last updated: 2022-10-01

Sometimes you want to divide the fields distinctly, whether in show, create or edit data

However, we have made these methods that help you in this either in general or specifically

Let's put an example of e-mail as one of the elements through which you can implement the same shape that you want in scaling the element with the name and password element

Col sizes from bootstrap  1 to 12 lg

php
php
php
php
php
php
public function fields() {
return [
text()->make('Name', 'name')->column(4),
email()->make('Email Address', 'email')->column(4),
password()->make('Password', 'password')->column(4)
];
}

The shape will be applied in all places

As for customization according to create or edit page

php
php
php
php
php
php
public function fields() {
return [
text()->make('Name', 'name')->column(4),
email()->make('Email Address', 'email')->columnWhenCreate(4),
password()->make('Password', 'password')->columnWhenUpdate(4)
];
}

You can also add the field size dynamically

php
php
php
php
php
php
public function fields() {
return [
text()->make('Name', 'name')->column(function(){
return $this->id == 1? 4:12;
}),
email()->make('Email Address', 'email')->columnWhenCreate(function(){
return $this->id == 1? 4:12;
}),
password()->make('Password', 'password')->columnWhenUpdate(function(){
return $this->id == 1? 4:12;
})
];
}

It can be applied in all places easily with the rest of the other elements