1
0
mirror of https://github.com/robonen/metr.git synced 2026-03-20 02:44:42 +00:00

Offer and order controllers

This commit is contained in:
2022-05-27 12:01:28 +07:00
parent c4f98fdb58
commit dc539ed911
21 changed files with 493 additions and 29 deletions

View File

@@ -18,25 +18,11 @@ class UserFactory extends Factory
public function definition()
{
return [
'name' => $this->faker->name(),
'first_name' => $this->faker->firstName(),
'last_name' => $this->faker->lastName(),
'email' => $this->faker->unique()->safeEmail(),
'email_verified_at' => now(),
'phone' => $this->faker->unique()->e164PhoneNumber(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'remember_token' => Str::random(10),
];
}
/**
* Indicate that the model's email address should be unverified.
*
* @return static
*/
public function unverified()
{
return $this->state(function (array $attributes) {
return [
'email_verified_at' => null,
];
});
}
}

View File

@@ -1,5 +1,6 @@
<?php
use App\Enums\OrderTypesEnum;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@@ -17,11 +18,12 @@ return new class extends Migration
$table->id();
$table->foreignId('owner_id');
$table->string('name');
$table->enum('type', ['studio']);
$table->enum('type', OrderTypesEnum::values());
$table->decimal('price');
$table->unsignedSmallInteger('rooms');
$table->string('yandex_mark')->nullable();
$table->text('text');
$table->string('location');
$table->text('description');
$table->boolean('is_group');
$table->timestamps();
});

View File

@@ -2,7 +2,7 @@
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use App\Models\User;
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
@@ -14,7 +14,7 @@ class DatabaseSeeder extends Seeder
*/
public function run()
{
// \App\Models\User::factory(10)->create();
User::factory(10)->create();
// \App\Models\User::factory()->create([
// 'name' => 'Test User',