質問編集履歴

1

Repositoryを追加しました。Modelの注入はしているはずなのですが、何か問題がありますでしょうか。

2016/10/06 15:51

投稿

AlwaysOreHungry
AlwaysOreHungry

スコア33

test CHANGED
File without changes
test CHANGED
@@ -83,3 +83,63 @@
83
83
  }
84
84
 
85
85
  ```
86
+
87
+
88
+
89
+ ```php
90
+
91
+ <?php
92
+
93
+
94
+
95
+ namespace App\Repositories;
96
+
97
+
98
+
99
+ use App\User;
100
+
101
+ use App\Sample;
102
+
103
+ use App\Repositories\RedRepositoryInterface;
104
+
105
+
106
+
107
+ class ColorRepository implements RedRepositoryInterface
108
+
109
+ {
110
+
111
+
112
+
113
+ public function __construct(User $user)
114
+
115
+ {
116
+
117
+ $this->user = $user;
118
+
119
+ }
120
+
121
+
122
+
123
+
124
+
125
+ public function getRed($user)
126
+
127
+ {
128
+
129
+
130
+
131
+ return DB::table('samples')
132
+
133
+ .
134
+
135
+ .
136
+
137
+ .
138
+
139
+ .
140
+
141
+ ->get();
142
+
143
+ }
144
+
145
+ ```