We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3b08793 commit d4ce470Copy full SHA for d4ce470
src/Extend/AddonRepository.php
@@ -4,6 +4,8 @@
4
5
class AddonRepository
6
{
7
+ protected $addons;
8
+
9
/**
10
* Make an addon instance.
11
*
@@ -25,7 +27,7 @@ public function make($addon)
25
27
*/
26
28
public function all()
29
- return app(Manifest::class)->addons()->map(function ($addon) {
30
+ return $this->addons = $this->addons ?? app(Manifest::class)->addons()->map(function ($addon) {
31
return $this->make($addon);
32
});
33
}
@@ -37,8 +39,6 @@ public function all()
37
39
38
40
public function get($id)
41
- return $this->make(
- app(Manifest::class)->addons()->get($id)
42
- );
+ return $this->all()->get($id);
43
44
0 commit comments