{{-- ? To set: * required: form_route as string exampe: route('orders.update', $order->id) array option: allow_statuses as array ids of allow statuses ['id' => 'output_name', ...] form_method as string default PUT value as string ? To implement in Blade: @includeIf('layouts.components.btn_status', ['form_route' => route('orders.update', $order->id)]) EXAMPLE: @includeIf('layouts.components.btn_status', [ 'form_route' => route('orders.update', $order->id), 'select_id' => "$order->status", 'allow_statuses' => [ 1 => 'Aktiv', 0 => 'Inaktiv', 2 => 'Storniert', 3 => 'Abgebrochen', 4 => 'Reaktiviert', 5 => 'Archiviert', 6 => 'Abgeschlossen', 7 => 'Fehlerhaft', ], ]) --}} @php use App\Enums\Statuses; $statuses = Statuses::asArray(); @endphp @if ( !empty($form_route) ) @includeIf('layouts.components.helper._section_css', ['component_name' => 'btn_status']) @php $status_color = [ 'active' => ['color' => '#fff', 'bg1' => '#41C7AF', 'bg2' => '#54E38E'], 'reactivated' => ['color' => 'rgb(61, 61, 61)', 'bg1' => '#47d997', 'bg2' => '#e4d829'], 'inactive' => ['color' => '#fff', 'bg1' => '#E13680', 'bg2' => '#A43AB2'], 'cancelled' => ['color' => '#e13636', 'bg1' => '#ffde65', 'bg2' => '#e13636'], 'archived' => ['color' => 'rgb(61, 61, 61)', 'bg1' => '#cacaca', 'bg2' => '#7f7f7f'], 'blocked' => ['color' => '#fff', 'bg1' => '#e13636', 'bg2' => '#ffde65'], 'completed' => ['color' => '#fff', 'bg1' => '#0cda68', 'bg2' => '#19a7f3'], 'incorrect' => ['color' => 'rgb(61, 61, 61)', 'bg1' => '#eef165', 'bg2' => '#e80e0e'], ]; $style = ''; echo $style; // NOT INCLUDED // $status_name_DE [ // 1 => 'Aktiv', // 0 => 'Inaktiv', // 2 => 'Storniert', // 3 => 'Abgebrochen', // 4 => 'Reaktiviert', // 5 => 'Archiviert', // 6 => 'Abgeschlossen', // 7 => 'Fehlerhaft', // ]; @endphp