3.0: Room repository and factory.

This commit is contained in:
2021-01-07 10:42:11 -08:00
parent 9575f69b35
commit 1d6c509982
7 changed files with 106 additions and 0 deletions

View File

View File

@@ -0,0 +1,19 @@
<?php
namespace App\Domain\Room\Factories;
use App\Models\Room;
/**
* Class RoomFactory
* @package App\Domain\Room\Factories
*/
class RoomFactory
{
public function create(string $name): Room
{
return Room::create([
'name' => $name
]);
}
}

View File

View File

@@ -0,0 +1,12 @@
<?php
namespace App\Domain\Room\Repositories;
/**
* Class RoomRepository
* @package App\Domain\Room\Repositories
*/
class RoomRepository
{
}

15
app/Models/Room.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Room extends Model
{
use HasFactory;
protected $fillable = [
'name'
];
}