Skip to content
This repository was archived by the owner on Jan 6, 2026. It is now read-only.

Commit fb1e490

Browse files
Add SettingsSection model, factory, migration, and seed operation; update Printers table with image column
1 parent 5326add commit fb1e490

File tree

5 files changed

+143
-0
lines changed

5 files changed

+143
-0
lines changed

app/Models/SettingsSection.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Models;
6+
7+
use Illuminate\Database\Eloquent\Factories\HasFactory;
8+
use Illuminate\Database\Eloquent\Model;
9+
use Illuminate\Database\Eloquent\Relations\Relation;
10+
use Illuminate\Database\Eloquent\SoftDeletes;
11+
12+
class SettingsSection extends Model
13+
{
14+
use HasFactory, SoftDeletes;
15+
16+
protected $fillable = [
17+
'parent_id',
18+
'title',
19+
];
20+
21+
public function parent(): Relation
22+
{
23+
return $this->belongsTo(static::class);
24+
}
25+
26+
public function childrens(): Relation
27+
{
28+
return $this->hasMany(SettingsSection::class, 'parent_id');
29+
}
30+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Database\Factories;
6+
7+
use App\Models\SettingsSection;
8+
use Illuminate\Database\Eloquent\Factories\Factory;
9+
use Illuminate\Support\Carbon;
10+
11+
class SettingsSectionFactory extends Factory
12+
{
13+
protected $model = SettingsSection::class;
14+
15+
public function definition(): array
16+
{
17+
return [
18+
'title' => $this->faker->word(),
19+
'created_at' => Carbon::now(),
20+
'updated_at' => Carbon::now(),
21+
];
22+
}
23+
}

database/migrations/2026_01_01_164438_create_printers_table.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public function up(): void
1717
$table->string('slug')->unique();
1818
$table->string('title');
1919

20+
$table->string('image')->nullable();
21+
2022
$table->timestamps();
2123
$table->softDeletes();
2224
});
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Illuminate\Database\Migrations\Migration;
6+
use Illuminate\Database\Schema\Blueprint;
7+
use Illuminate\Support\Facades\Schema;
8+
9+
return new class extends Migration {
10+
public function up(): void
11+
{
12+
Schema::create('settings_sections', function (Blueprint $table) {
13+
$table->id();
14+
15+
$table->bigInteger('parent_id')->nullable();
16+
17+
$table->string('title');
18+
19+
$table->timestamps();
20+
$table->softDeletes();
21+
});
22+
}
23+
};
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use DragonCode\LaravelDeployOperations\Operation;
6+
7+
return new class extends Operation {
8+
protected array $items = [
9+
'Общая информация' => [
10+
'Область печати' => [
11+
'Размер стола',
12+
'Высота печати',
13+
],
14+
15+
'Аксессуары' => [
16+
'Тип сопла',
17+
],
18+
],
19+
20+
'Экструдер' => [
21+
'Размер' => [
22+
'Диаметр сопла',
23+
],
24+
25+
'Ограничения высоты' => [
26+
'Минимальная высота слоя',
27+
'Максимальная высота слоя',
28+
],
29+
30+
'Дополнительно' => [
31+
'Время загрузки прутка',
32+
'Время выгрузки прутка',
33+
'Время смены инструмента',
34+
],
35+
],
36+
37+
'Ограничения' => [
38+
'Максимальные скорости перемещения' => [
39+
'По оси X',
40+
'По оси Y',
41+
'По оси Z',
42+
'Подача экструдера',
43+
],
44+
45+
'Максимальные ускорения' => [
46+
'По оси X',
47+
'По оси Y',
48+
'По оси Z',
49+
'Подача экструдера',
50+
'При печати',
51+
'Откат',
52+
'Холостые перемещения',
53+
],
54+
55+
'Максимальные рывки' => [
56+
'По оси X',
57+
'По оси Y',
58+
'По оси Z',
59+
'Рывок экструдера',
60+
],
61+
],
62+
];
63+
64+
public function __invoke(): void {}
65+
};

0 commit comments

Comments
 (0)