Skip to content

Instantly share code, notes, and snippets.

@robozavri
Last active December 14, 2018 13:43
Show Gist options
  • Select an option

  • Save robozavri/41b3e15788e97882ec239b57a1892b9a to your computer and use it in GitHub Desktop.

Select an option

Save robozavri/41b3e15788e97882ec239b57a1892b9a to your computer and use it in GitHub Desktop.
Laravel laraadmin create module fielad
use Dwij\Laraadmin\Controllers\FieldController;
$titles = [
'ქალაქი' => 'city',
'რეგიონი' => 'region',
'დონორი' => 'donor',
'კონტრაქტორი' => 'contractor',
'ხელშეკრულების ხელმოწერის თარიღი' => 'Signing_contract_date',
'სამუშაოების დაწყების თარიღი' => 'job_start_date',
'სამუშაოების თავდაპირველი დასრულების თარიღი' => 'job_original_finish_date',
'სამუშაოების თავდაპირველი ღირებულება, ლარი' => 'job_original_price_lari',
'სამუშაოების შეცვლილი ღირებულება, ლარი' => 'finished_job',
'შესრულებული სამუშაო' => 'executed_job',
'ანაზღაურებული თანხა, ლარი' => 'payed_amount',
];
$request = new \Illuminate\Http\Request();
$Cfiled = new FieldController;
foreach($titles as $key => $value){
$request->replace([
'module_id' => 14,
'colname' => $value,
'label' => $key,
'field_type' => 19,
'defaultvalue' => '',
'maxlength' => 100,
'minlength' => '',
"popup_value_type" => "table",
"popup_vals_table" => "departments",
]);
// dump([
// 'module_id' => 14,
// 'colname' => $value,
// 'label' => $key,
// 'field_type' => 19,
// 'defaultvalue' => '',
// 'maxlength' => 100,
// 'minlength' => '',
// "popup_value_type" => "table",
// "popup_vals_table" => "departments",
// ]);
$Cfiled->store($request);
}
@robozavri
Copy link
Copy Markdown
Author

სადმე შევქმნით კონტროლერს და იქ
use Dwij\Laraadmin\Controllers\FieldController;

$request = new \Illuminate\Http\Request();
$Cfiled = new FieldController;

$request->replace([
            'module_id'        => 14,
            'colname'          => $value,
            'label'            => $key,
            'field_type'       => 19,
            'defaultvalue'     => '',
            'maxlength'        => 100,
            'minlength'        => '',
            "popup_value_type" => "table",
            "popup_vals_table" => "departments",
        ]);

$Cfiled->store($request);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment