File tree Expand file tree Collapse file tree 9 files changed +27
-12
lines changed
Expand file tree Collapse file tree 9 files changed +27
-12
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ class Kernel extends HttpKernel
5353 *
5454 * @var array
5555 */
56- protected $ routeMiddleware = [
56+ protected $ middlewareAliases = [
5757 'auth ' => \Illuminate \Auth \Middleware \Authenticate::class,
5858 'auth.basic ' => \Illuminate \Auth \Middleware \AuthenticateWithBasicAuth::class,
5959 'bindings ' => \Illuminate \Routing \Middleware \SubstituteBindings::class,
Original file line number Diff line number Diff line change 2727 */
2828class CardImage extends Model
2929{
30- protected $ casts = ['last_uploaded ' => 'datetime ' ];
31-
3230 public function getMd5 (): string
3331 {
3432 return $ this ->getAttribute ('md5 ' );
@@ -38,4 +36,8 @@ public function getLastUploaded(): ?\DateTimeInterface
3836 {
3937 return $ this ->getAttribute ('last_uploaded ' );
4038 }
39+ protected function casts (): array
40+ {
41+ return ['last_uploaded ' => 'datetime ' ];
42+ }
4143}
Original file line number Diff line number Diff line change @@ -38,8 +38,10 @@ public function getFullName(string $locale): string
3838 return sprintf ('%s %s ' , $ name , $ this ->version );
3939 }
4040
41- public function getBrandAttribute ()
41+ protected function brand (): \ Illuminate \ Database \ Eloquent \ Casts \ Attribute
4242 {
43- return BrandMapper::getBrand ($ this ->name_ja );
43+ return \Illuminate \Database \Eloquent \Casts \Attribute::make (get: function () {
44+ return BrandMapper::getBrand ($ this ->name_ja );
45+ });
4446 }
4547}
Original file line number Diff line number Diff line change 77use amcsi \LyceeOverture \Card \Type ;
88use Illuminate \Database \Eloquent \Factories \Factory ;
99
10+ /**
11+ * @extends \Illuminate\Database\Eloquent\Factories\Factory<\amcsi\LyceeOverture\Models\Card>
12+ */
1013class CardFactory extends Factory
1114{
1215 private static $ increment = 1 ;
Original file line number Diff line number Diff line change 99use amcsi \LyceeOverture \I18n \Locale ;
1010use Illuminate \Database \Eloquent \Factories \Factory ;
1111
12+ /**
13+ * @extends \Illuminate\Database\Eloquent\Factories\Factory<\amcsi\LyceeOverture\Models\CardTranslation>
14+ */
1215class CardTranslationFactory extends Factory
1316{
1417 protected $ model = CardTranslation::class;
Original file line number Diff line number Diff line change 99use amcsi \LyceeOverture \Models \User ;
1010use Illuminate \Database \Eloquent \Factories \Factory ;
1111
12+ /**
13+ * @extends \Illuminate\Database\Eloquent\Factories\Factory<\amcsi\LyceeOverture\Models\Suggestion>
14+ */
1215class SuggestionFactory extends Factory
1316{
1417 protected $ model = Suggestion::class;
Original file line number Diff line number Diff line change 77use Illuminate \Database \Eloquent \Factories \Factory ;
88use Illuminate \Support \Str ;
99
10+ /**
11+ * @extends \Illuminate\Database\Eloquent\Factories\Factory<\amcsi\LyceeOverture\Models\User>
12+ */
1013class UserFactory extends Factory
1114{
1215 /**
@@ -24,8 +27,8 @@ class UserFactory extends Factory
2427 public function definition ()
2528 {
2629 return [
27- 'name ' => $ this -> faker ->name ,
28- 'email ' => $ this -> faker ->unique ()->safeEmail ,
30+ 'name ' => fake () ->name ,
31+ 'email ' => fake () ->unique ()->safeEmail ,
2932 'password ' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm ' , // secret
3033 'remember_token ' => Str::random (10 ),
3134 'can_approve_locale ' => '' ,
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ function (Blueprint $table) {
2020 $ table ->increments ('id ' );
2121 $ table ->string ('name_jp ' );
2222 $ table ->string ('name_en ' )->default ('' );
23- $ table ->string ('cards ' )-> string () ;
23+ $ table ->string ('cards ' );
2424 $ table ->boolean ('deck ' );
2525 $ table ->timestamps ();
2626 }
Original file line number Diff line number Diff line change 33use Illuminate \Database \Migrations \Migration ;
44use Illuminate \Database \Schema \Blueprint ;
55
6- return new class extends Migration
7- {
6+ return new class extends Migration {
87 public function up (): void
98 {
109 \Schema::table ('card_translations ' , function (Blueprint $ table ) {
11- $ table ->text ('comments ' )->default ('' )->change ();
10+ $ table ->string ('comments ' , 2000 )->default ('' )->change ();
1211 });
1312 \Schema::table ('suggestions ' , function (Blueprint $ table ) {
14- $ table ->text ('comments ' )->default ('' )->change ();
13+ $ table ->string ('comments ' , 2000 )->default ('' )->change ();
1514 });
1615 }
1716
You can’t perform that action at this time.
0 commit comments