From 5458a9f4b3228f7461e01dd55e162d1e2e6c29b5 Mon Sep 17 00:00:00 2001 From: daurensky Date: Wed, 3 Apr 2024 18:47:35 +0000 Subject: [PATCH] Fix styling --- src/Models/Review.php | 6 +++--- src/UI/API/Controllers/ReviewController.php | 3 ++- src/UI/API/Data/ReviewData.php | 5 ++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Models/Review.php b/src/Models/Review.php index 1cae16c..df33414 100644 --- a/src/Models/Review.php +++ b/src/Models/Review.php @@ -2,13 +2,13 @@ namespace AdminKit\Reviews\Models; -use Spatie\MediaLibrary\HasMedia; -use Spatie\MediaLibrary\InteractsWithMedia; use AdminKit\Core\Abstracts\Models\AbstractModel; +use AdminKit\Reviews\Database\Factories\ReviewFactory; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Factories\HasFactory; +use Spatie\MediaLibrary\HasMedia; +use Spatie\MediaLibrary\InteractsWithMedia; use Spatie\Translatable\HasTranslations; -use AdminKit\Reviews\Database\Factories\ReviewFactory; /** * @property-read string $text diff --git a/src/UI/API/Controllers/ReviewController.php b/src/UI/API/Controllers/ReviewController.php index bdafdfc..fd04dfe 100644 --- a/src/UI/API/Controllers/ReviewController.php +++ b/src/UI/API/Controllers/ReviewController.php @@ -5,8 +5,8 @@ namespace AdminKit\Reviews\UI\API\Controllers; use AdminKit\Reviews\Models\Review; -use Spatie\LaravelData\DataCollection; use AdminKit\Reviews\UI\API\Data\ReviewData; +use Spatie\LaravelData\DataCollection; class ReviewController extends Controller { @@ -15,6 +15,7 @@ public function index(): DataCollection $reviews = Review::query() ->latest() ->get(); + return ReviewData::collection($reviews); } } diff --git a/src/UI/API/Data/ReviewData.php b/src/UI/API/Data/ReviewData.php index d0f9122..ab70b7c 100644 --- a/src/UI/API/Data/ReviewData.php +++ b/src/UI/API/Data/ReviewData.php @@ -2,8 +2,8 @@ namespace AdminKit\Reviews\UI\API\Data; -use Spatie\LaravelData\Data; use AdminKit\Reviews\Models\Review; +use Spatie\LaravelData\Data; class ReviewData extends Data { @@ -12,8 +12,7 @@ public function __construct( public string $author, public string $bio, public string $photo, - ) - { + ) { } public static function fromModel(Review $review): ReviewData