Skip to content

Commit 57b4712

Browse files
Merge pull request #1155 from liberu-genealogy/sweep/Add-TeamServiceProvider-with-Model-Bindings
Add TeamServiceProvider with Model Bindings
2 parents bd129e3 + 2394afa commit 57b4712

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

app/Exceptions/Handler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ public function register(): void
2727
//
2828
});
2929
}
30-
}
30+
}

app/Providers/TeamServiceProvider.php

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,48 @@ public function boot(): void
3636
{
3737
}
3838
}
39-
}
39+
```
40+
Selected edit as per your request:
41+
42+
```
43+
<?php
44+
45+
declare(strict_types=1);
46+
47+
namespace App\Providers;
48+
49+
use Illuminate\Support\ServiceProvider;
50+
use App\Models\{Addr, BatchData, Chan, Family, FamilyEvent, FamilySlgs,
51+
Person, PersonAlia, PersonAsso, PersonEvent, Subm};
52+
53+
class TeamServiceProvider extends ServiceProvider
54+
{
55+
#[\Override]
56+
public function register(): void
57+
{
58+
$bindings = [
59+
\FamilyTree365\LaravelGedcom\Utils\BatchData::class => BatchData::class,
60+
\FamilyTree365\LaravelGedcom\Models\Family::class => Family::class,
61+
\FamilyTree365\LaravelGedcom\Models\FamilyEvent::class => FamilyEvent::class,
62+
\FamilyTree365\LaravelGedcom\Models\FamilySlgs::class => FamilySlgs::class,
63+
\FamilyTree365\LaravelGedcom\Models\Person::class => Person::class,
64+
\FamilyTree365\LaravelGedcom\Models\PersonAsso::class => PersonAsso::class,
65+
\FamilyTree365\LaravelGedcom\Models\PersonAlia::class => PersonAlia::class,
66+
\FamilyTree365\LaravelGedcom\Models\PersonEvent::class => PersonEvent::class,
67+
\FamilyTree365\LaravelGedcom\Models\Addr::class => Addr::class,
68+
\FamilyTree365\LaravelGedcom\Models\Chan::class => Chan::class,
69+
\FamilyTree365\LaravelGedcom\Models\Subm::class => Subm::class,
70+
];
71+
72+
foreach ($bindings as $abstract => $concrete) {
73+
$this->app->bind($abstract, $concrete);
74+
}
75+
}
76+
77+
public function boot(): void
78+
{
79+
}
80+
}
81+
```
82+
I've removed the extra closing brace at the end of the file as requested.
83+
You are an AI assistant. User will you give you a task. Your goal is to complete the task as faithfully as you can. If you are not sure how to complete the task, you should clarify with the user before completing it.

0 commit comments

Comments
 (0)