Skip to content

Commit f73180a

Browse files
kfriarsgithub-actions[bot]
authored andcommitted
Fix styling
1 parent 85d2713 commit f73180a

19 files changed

+42
-45
lines changed

config/frontdesk.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
return [
99
'models' => [
1010
'hyperlink' => Hyperlink::class,
11-
'menu' => Menu::class
11+
'menu' => Menu::class,
1212
],
1313
'factories' => [
1414
'hyperlink' => HyperlinkFactory::class,
15-
'menu' => MenuFactory::class
16-
]
17-
];
15+
'menu' => MenuFactory::class,
16+
],
17+
];

src/Concerns/HasMenus.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,19 @@
22

33
namespace Plank\Frontdesk\Concerns;
44

5-
use Illuminate\Database\Eloquent\Model;
65
use Illuminate\Database\Eloquent\Relations\MorphToMany;
76
use Plank\Frontdesk\Models\Menu;
7+
88
/**
99
* @mixin \Illuminate\Database\Eloquent\Model
1010
*
1111
* @property-read Collection<Menu> $menus
1212
*/
1313
trait HasMenus
1414
{
15-
/**
16-
* @return MorphToMany
17-
*/
1815
public function menus(): MorphToMany
1916
{
2017
return $this->morphToMany(Menu::class, 'menuable')
2118
->orderByPivot('order');
2219
}
23-
}
20+
}

src/Concerns/IsLinkable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ public function hyperlinks(): MorphMany
1616
{
1717
return $this->morphMany(config('frontdesk.models.hyperlink'), 'linkable');
1818
}
19-
}
19+
}

src/Contracts/AggregatesLinks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
interface AggregatesLinks
1414
{
1515
public function hyperlinks(): HasMany;
16-
}
16+
}

src/Contracts/Linkable.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Illuminate\Database\Eloquent\Collection;
77
use Illuminate\Database\Eloquent\Model;
88
use Illuminate\Database\Eloquent\Relations\MorphMany;
9+
910
/**
1011
* @property-read Collection<Model&LinksToContent> $hyperlinks
1112
* @property-read string $linkTitle
@@ -18,4 +19,4 @@ public function hyperlinks(): MorphMany;
1819
public function linkTitle(): Attribute;
1920

2021
public function linkUrl(): Attribute;
21-
}
22+
}

src/Contracts/LinksToContent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ public function menu(): BelongsTo;
2828
public function parent(): BelongsTo;
2929

3030
public function children(): HasMany;
31-
}
31+
}

src/Contracts/Menuable.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
use Illuminate\Database\Eloquent\Model;
77
use Illuminate\Database\Eloquent\Relations\MorphToMany;
88

9-
109
/**
1110
* @property-read Collection<Model&AggregatesLinks> $menus
1211
* Could add $navs to this interface if you decide to implement it
1312
*/
1413
interface Menuable
1514
{
1615
public function menus(): MorphToMany;
17-
}
16+
}

src/Models/Hyperlink.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,28 @@ public function linkable(): MorphTo
3838
public function menu(): BelongsTo
3939
{
4040
$menuClass = config('frontdesk.models.menu');
41+
4142
return $this->belongsTo($menuClass);
4243
}
4344

4445
public function parent(): BelongsTo
4546
{
4647
$hyperlinkModel = config('frontdesk.models.hyperlink');
48+
4749
return $this->belongsTo($hyperlinkModel);
4850
}
4951

5052
public function children(): HasMany
5153
{
5254
$hyperlinkModel = config('frontdesk.models.hyperlink');
55+
5356
return $this->hasMany($hyperlinkModel, 'parent_id');
5457
}
5558

5659
protected static function newFactory()
5760
{
5861
$factory = config('frontdesk.factories.hyperlink');
62+
5963
return $factory::new();
6064
}
61-
}
65+
}

src/Models/Menu.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ class Menu extends Model implements AggregatesLinks
1616
public function hyperlinks(): HasMany
1717
{
1818
$hyperlinkModel = config('frontdesk.models.hyperlink');
19+
1920
return $this->hasMany($hyperlinkModel);
2021
}
2122

2223
protected static function newFactory()
2324
{
2425
$factory = config('frontdesk.factories.menu');
26+
2527
return $factory::new();
2628
}
27-
}
29+
}

tests/Database/Factories/ArticleFactory.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Plank\Frontdesk\Tests\Database\Factories;
44

55
use Illuminate\Database\Eloquent\Factories\Factory;
6-
use Illuminate\Support\Str;
76
use Plank\Frontdesk\Tests\Models\Article;
87

98
/**
@@ -22,7 +21,7 @@ public function definition(): array
2221
{
2322
return [
2423
'title' => fake()->words(1, true),
25-
'body' => fake()->text(100)
24+
'body' => fake()->text(100),
2625
];
2726
}
2827
}

0 commit comments

Comments
 (0)