質問編集履歴
1
Repositoryを追加しました。Modelの注入はしているはずなのですが、何か問題がありますでしょうか。
title
CHANGED
File without changes
|
body
CHANGED
@@ -40,4 +40,34 @@
|
|
40
40
|
}
|
41
41
|
|
42
42
|
}
|
43
|
+
```
|
44
|
+
|
45
|
+
```php
|
46
|
+
<?php
|
47
|
+
|
48
|
+
namespace App\Repositories;
|
49
|
+
|
50
|
+
use App\User;
|
51
|
+
use App\Sample;
|
52
|
+
use App\Repositories\RedRepositoryInterface;
|
53
|
+
|
54
|
+
class ColorRepository implements RedRepositoryInterface
|
55
|
+
{
|
56
|
+
|
57
|
+
public function __construct(User $user)
|
58
|
+
{
|
59
|
+
$this->user = $user;
|
60
|
+
}
|
61
|
+
|
62
|
+
|
63
|
+
public function getRed($user)
|
64
|
+
{
|
65
|
+
|
66
|
+
return DB::table('samples')
|
67
|
+
.
|
68
|
+
.
|
69
|
+
.
|
70
|
+
.
|
71
|
+
->get();
|
72
|
+
}
|
43
73
|
```
|