Added pre-pro and printed toggles to order

orders
Nisse Lommerde 4 weeks ago
parent 3c98de929e
commit d950955371

@ -41,7 +41,8 @@ class OrderResource extends Resource
return $form->schema([ return $form->schema([
Section::make([ Section::make([
Section::make([ Grid::make(1)
->schema([
Select::make('order_type') Select::make('order_type')
->required() ->required()
->options(OrderType::class) ->options(OrderType::class)
@ -76,9 +77,14 @@ class OrderResource extends Resource
->required() ->required()
->default(today()->add('10 days')), ->default(today()->add('10 days')),
]), ]),
Textarea::make('notes')
->rows(3),
])->columnSpan(1), ])->columnSpan(1),
Section::make([ Grid::make(1)
->schema([
ToggleButtons::make('status') ToggleButtons::make('status')
->required() ->required()
->options(OrderStatus::class) ->options(OrderStatus::class)
@ -89,8 +95,17 @@ class OrderResource extends Resource
->multiple() ->multiple()
->inline(), ->inline(),
Textarea::make('notes') ToggleButtons::make('printed')
->rows(3), ->boolean()
->inline(),
ToggleButtons::make('pre_production')
->label('Pre-production')
->boolean()
->inline()
->colors([
'true' => 'info',
'false' => 'info',
]),
])->columnSpan(1), ])->columnSpan(1),
])->columns(2), ])->columns(2),
@ -126,7 +141,7 @@ class OrderResource extends Resource
->cloneable(), ->cloneable(),
Repeater::make('services') Repeater::make('services')
->label('Production Details') ->label('Product Services')
->schema([ ->schema([
Grid::make(19) Grid::make(19)
->schema([ ->schema([

@ -38,6 +38,8 @@ class Order extends Model
'digitizing', 'digitizing',
'garments', 'garments',
'supplied_file', 'supplied_file',
'printed',
'pre_production',
]; ];
protected $casts = [ protected $casts = [

@ -28,6 +28,9 @@ return new class extends Migration
$table->boolean('garments')->default(0); $table->boolean('garments')->default(0);
$table->boolean('supplied_file')->default(0); $table->boolean('supplied_file')->default(0);
$table->boolean('printed')->default(0);
$table->boolean('pre_production')->default(0);
$table->softDeletes(); $table->softDeletes();
$table->timestamps(); $table->timestamps();
}); });

@ -14,7 +14,7 @@ class ContactSeeder extends Seeder
public function run(): void public function run(): void
{ {
foreach (Customer::all() as $customer) { foreach (Customer::all() as $customer) {
if ($customer->company_name == 'Genumark') { if ($customer->company_name === 'Genumark') {
$customer->contacts()->createMany([ $customer->contacts()->createMany([
[ [
'first_name' => 'Tammy', 'first_name' => 'Tammy',
@ -50,7 +50,7 @@ class ContactSeeder extends Seeder
], ],
]); ]);
} else { } else {
Contact::factory(rand(1, 4))->for($customer); Contact::factory(rand(1, 4))->for($customer)->create();
} }
} }
} }

Loading…
Cancel
Save