質問編集履歴
3
不足していた情報の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -49,3 +49,179 @@
|
|
49
49
|
などのUserクラス相当のものを作成したいとも思っています。
|
50
50
|
|
51
51
|
どなたかご存知の方、教えていただけたら嬉しいです。
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
[追記]
|
56
|
+
|
57
|
+
実際のコードを追記させていただきます。変更したファイルはマイグレーションファイルと、モデルの2ファイルのみです。
|
58
|
+
|
59
|
+
* 2014_10_12_000000_create_end_users_table.php
|
60
|
+
|
61
|
+
```
|
62
|
+
|
63
|
+
<?php
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
use Illuminate\Support\Facades\Schema;
|
68
|
+
|
69
|
+
use Illuminate\Database\Schema\Blueprint;
|
70
|
+
|
71
|
+
use Illuminate\Database\Migrations\Migration;
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
class CreateEndUsersTable extends Migration
|
76
|
+
|
77
|
+
{
|
78
|
+
|
79
|
+
/**
|
80
|
+
|
81
|
+
* Run the migrations.
|
82
|
+
|
83
|
+
*
|
84
|
+
|
85
|
+
* @return void
|
86
|
+
|
87
|
+
*/
|
88
|
+
|
89
|
+
public function up()
|
90
|
+
|
91
|
+
{
|
92
|
+
|
93
|
+
Schema::create('end_users', function (Blueprint $table) {
|
94
|
+
|
95
|
+
$table->increments('id');
|
96
|
+
|
97
|
+
$table->string('name');
|
98
|
+
|
99
|
+
$table->string('email')->unique();
|
100
|
+
|
101
|
+
$table->string('password');
|
102
|
+
|
103
|
+
$table->rememberToken();
|
104
|
+
|
105
|
+
$table->softDeletes();
|
106
|
+
|
107
|
+
$table->timestamps();
|
108
|
+
|
109
|
+
});
|
110
|
+
|
111
|
+
}
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
/**
|
116
|
+
|
117
|
+
* Reverse the migrations.
|
118
|
+
|
119
|
+
*
|
120
|
+
|
121
|
+
* @return void
|
122
|
+
|
123
|
+
*/
|
124
|
+
|
125
|
+
public function down()
|
126
|
+
|
127
|
+
{
|
128
|
+
|
129
|
+
Schema::dropIfExists('end_users');
|
130
|
+
|
131
|
+
}
|
132
|
+
|
133
|
+
}
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
```
|
138
|
+
|
139
|
+
* App/Models/EndUser
|
140
|
+
|
141
|
+
```
|
142
|
+
|
143
|
+
<?php
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
namespace App\Models;
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
use Illuminate\Notifications\Notifiable;
|
152
|
+
|
153
|
+
use Illuminate\Foundation\Auth\User as Authenticatable;
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
use Tymon\JWTAuth\Contracts\JWTSubject;
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
class EndUser extends Authenticatable implements JWTSubject
|
162
|
+
|
163
|
+
{
|
164
|
+
|
165
|
+
use Notifiable;
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
/**
|
170
|
+
|
171
|
+
* The attributes that are mass assignable.
|
172
|
+
|
173
|
+
*
|
174
|
+
|
175
|
+
* @var array
|
176
|
+
|
177
|
+
*/
|
178
|
+
|
179
|
+
protected $fillable = [
|
180
|
+
|
181
|
+
'name', 'email', 'password',
|
182
|
+
|
183
|
+
];
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
/**
|
188
|
+
|
189
|
+
* The attributes that should be hidden for arrays.
|
190
|
+
|
191
|
+
*
|
192
|
+
|
193
|
+
* @var array
|
194
|
+
|
195
|
+
*/
|
196
|
+
|
197
|
+
protected $hidden = [
|
198
|
+
|
199
|
+
'password', 'remember_token',
|
200
|
+
|
201
|
+
];
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
public function getJWTIdentifier()
|
206
|
+
|
207
|
+
{
|
208
|
+
|
209
|
+
return $this->getKey();
|
210
|
+
|
211
|
+
}
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
public function getJWTCustomClaims()
|
216
|
+
|
217
|
+
{
|
218
|
+
|
219
|
+
return [];
|
220
|
+
|
221
|
+
}
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
}
|
226
|
+
|
227
|
+
```
|
2
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
-
といった形で存在します。
|
13
|
+
といった形で複数存在します。
|
14
14
|
|
15
15
|
そこでなのですが、Laravelで標準で存在しているUserモデルの名前などを、
|
16
16
|
|
1
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,9 +4,9 @@
|
|
4
4
|
|
5
5
|
B to B(自分) to CのWeサービスなので、Userが
|
6
6
|
|
7
|
+
* エンドユーザー
|
8
|
+
|
7
9
|
* 法人
|
8
|
-
|
9
|
-
* エンドユーザー
|
10
10
|
|
11
11
|
|
12
12
|
|