Merge branch 'develop' into trunk
This commit is contained in:
commit
7a2f64e134
3 changed files with 48 additions and 3 deletions
|
|
@ -7,6 +7,7 @@ use Kwaadpepper\Enum\BaseEnum;
|
|||
/**
|
||||
* @method static self new()
|
||||
* @method static self inprogress()
|
||||
* @method static self waiting()
|
||||
* @method static self processed()
|
||||
* @method static self recette()
|
||||
* @method static self production()
|
||||
|
|
@ -19,9 +20,10 @@ class TicketStatus extends BaseEnum
|
|||
return [
|
||||
'new' => 1,
|
||||
'inprogress' => 2,
|
||||
'processed' => 3,
|
||||
'recette' => 4,
|
||||
'production' => 5,
|
||||
'waiting' => 3,
|
||||
'processed' => 4,
|
||||
'recette' => 5,
|
||||
'production' => 6,
|
||||
'archived' => 9,
|
||||
];
|
||||
}
|
||||
|
|
@ -31,6 +33,7 @@ class TicketStatus extends BaseEnum
|
|||
return [
|
||||
'new' => trans('Nouveau'),
|
||||
'inprogress' => trans('En cours'),
|
||||
'waiting' => trans('En attente'),
|
||||
'processed' => trans('Traité'),
|
||||
'recette' => trans('En recettage'),
|
||||
'production' => trans('En production'),
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
use App\Enums\TicketStatus;
|
||||
use App\Models\Ticket;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class UpdateTicketsStatusWithEnumStatus2 extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
foreach (Ticket::where('status', 5)->get() as $ticket) {
|
||||
$ticket->status = TicketStatus::production();
|
||||
$ticket->save();
|
||||
}
|
||||
foreach (Ticket::where('status', 4)->get() as $ticket) {
|
||||
$ticket->status = TicketStatus::recette();
|
||||
$ticket->save();
|
||||
}
|
||||
foreach (Ticket::where('status', 3)->get() as $ticket) {
|
||||
$ticket->status = TicketStatus::processed();
|
||||
$ticket->save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
|
|
@ -86,6 +86,7 @@
|
|||
$cls = (!$cls && $ticket->status == TicketStatus::recette()) ? 'text-primary' : $cls;
|
||||
$cls = (!$cls && $ticket->status == TicketStatus::production()) ? 'text-success' : $cls;
|
||||
$cls = (!$cls && $ticket->status == TicketStatus::inprogress()) ? 'text-dark' : $cls;
|
||||
$cls = (!$cls && $ticket->status == TicketStatus::waiting()) ? 'text-white bg-danger' : $cls;
|
||||
@endphp
|
||||
<td><span class="{{ $cls }}">{{ $ticket->status->label }}</span></td>
|
||||
<td>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue