Fix parsing input values

This commit is contained in:
2021-01-12 10:56:34 +03:00
parent 899da1a967
commit d12744296a
4 changed files with 58 additions and 3 deletions

View 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');
}
}

View 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();
}
}
}