Fix parsing input values
This commit is contained in:
@@ -33,7 +33,7 @@ class HRCCommand extends Command
|
|||||||
private function prepareRaw()
|
private function prepareRaw()
|
||||||
{
|
{
|
||||||
$source_file = base_path() . '/../temp/' . $this->argument('source');
|
$source_file = base_path() . '/../temp/' . $this->argument('source');
|
||||||
return json_decode(file_get_contents($source_file));
|
return parse_ini_file($source_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function save($result)
|
public function save($result)
|
||||||
|
|||||||
34
database/migrations/2020_01_01_000000_create_test_table.php
Normal file
34
database/migrations/2020_01_01_000000_create_test_table.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class CreateTestTable extends Migration {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('test', function(Blueprint $table)
|
||||||
|
{
|
||||||
|
$table->increments('id');
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::drop('test');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
21
database/seeds/AddTestRight.php
Normal file
21
database/seeds/AddTestRight.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
|
class AddTestRight extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function run()
|
||||||
|
{
|
||||||
|
if(\App\Models\Right::where('code', 'test')->count() == 0) {
|
||||||
|
$right = new \App\Models\Right();
|
||||||
|
$right->code = 'test';
|
||||||
|
$right->name = 'Тестовый раздел';
|
||||||
|
$right->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,6 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class Permission extends Model {
|
class Right extends Model {
|
||||||
protected $table = 'users';
|
protected $table = 'rights';
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user