help desk crud

This commit is contained in:
merdan 2020-04-29 18:34:18 +05:00
parent 08626cfeee
commit b9e26d15d5
3 changed files with 14 additions and 0 deletions

View File

@ -36,6 +36,7 @@ class HelpTicketCategoryCrudController extends CrudController
// TODO: remove setFromDb() and manually define Fields and Columns
// $this->crud->setFromDb();
$this->crud->setColumns([
['name' => 'position','label'=>'Order Position','type'=>'number'],
['name' => 'title_tk','label'=>'Title Turkmen','type'=>'text'],
['name' => 'title_ru','label'=>'Title Russioan','type'=>'text'],
['name' => 'active', 'label' => 'Active', 'type' => 'check']
@ -43,6 +44,7 @@ class HelpTicketCategoryCrudController extends CrudController
$this->crud->addFields([
['name' => 'title_tk','label'=>'Title Turkmen','type'=>'text'],
['name' => 'position','label'=>'Order Position','type'=>'number'],
['name' => 'title_ru','label'=>'Title Russioan','type'=>'text'],
['name' => 'active', 'label' => 'Active', 'type' => 'checkbox']
]);

View File

@ -59,4 +59,15 @@ class HelpTicket extends Model
| MUTATORS
|--------------------------------------------------------------------------
*/
/**
* Boot all of the bootable traits on the model.
*/
public static function boot()
{
parent::boot();
static::creating(function ($ticket) {
$ticket->code = strtoupper(str_random(5)) . date('jn');
});
}
}

View File

@ -17,6 +17,7 @@ class CreateHelpTicketCategoriesTable extends Migration
$table->string('title_tk');
$table->string('title_ru');
$table->boolean('active')->default(1);
$table->integer('position')->default(1);
});
}