создаваемые файлы Модели
- app\Models\Elements.php
модель таблицы elements БД
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Elements extends Model
{
use HasFactory;
}
- app\database\xxxx_xx_xx_xxxxxx_create_elements_table.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateElementsTable extends Migration
{
public function up()
{
Schema::create('elements', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name');
$table->text('description');
$table->text('body');
});
}
public function down()
{
Schema::dropIfExists('elements');
}
}