diff --git a/core/app/Console/Commands/HRCCommand.php b/core/app/Console/Commands/HRCCommand.php index 9ab4928..61445ca 100644 --- a/core/app/Console/Commands/HRCCommand.php +++ b/core/app/Console/Commands/HRCCommand.php @@ -33,7 +33,7 @@ class HRCCommand extends Command private function prepareRaw() { $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) diff --git a/database/migrations/2020_01_01_000000_create_test_table.php b/database/migrations/2020_01_01_000000_create_test_table.php new file mode 100644 index 0000000..d0c22b7 --- /dev/null +++ b/database/migrations/2020_01_01_000000_create_test_table.php @@ -0,0 +1,34 @@ +increments('id'); + $table->timestamps(); + }); + } + + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('test'); + } + +} diff --git a/database/seeds/AddTestRight.php b/database/seeds/AddTestRight.php new file mode 100644 index 0000000..b4d9880 --- /dev/null +++ b/database/seeds/AddTestRight.php @@ -0,0 +1,21 @@ +count() == 0) { + $right = new \App\Models\Right(); + $right->code = 'test'; + $right->name = 'Тестовый раздел'; + $right->save(); + } + } +} diff --git a/models/Right.php b/models/Right.php index de416a5..cd96bde 100644 --- a/models/Right.php +++ b/models/Right.php @@ -4,6 +4,6 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; -class Permission extends Model { - protected $table = 'users'; +class Right extends Model { + protected $table = 'rights'; } \ No newline at end of file