diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml index c354807e..cbc85a82 100644 --- a/.github/workflows/laravel.yml +++ b/.github/workflows/laravel.yml @@ -31,7 +31,7 @@ jobs: run: php artisan key:generate - name: Check coding style - run: vendor/bin/ecs check + run: vendor/bin/ecs --clear-cache - name: Execute tests (Unit and Feature tests) via PHPUnit run: vendor/bin/phpunit tests/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 32d61e81..34e83483 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.0.0 +- Cover all endpoints with tests +- Add coding style + # v0.5.3 - Update OpenApi spec and endpoints - Delete responses now return 204 diff --git a/app/Console/Commands/BarExportCocktails.php b/app/Console/Commands/BarExportCocktails.php index d99b18ae..2557f624 100644 --- a/app/Console/Commands/BarExportCocktails.php +++ b/app/Console/Commands/BarExportCocktails.php @@ -3,8 +3,8 @@ namespace Kami\Cocktail\Console\Commands; use Illuminate\Console\Command; -use Kami\Cocktail\Models\Cocktail; use Symfony\Component\Yaml\Yaml; +use Kami\Cocktail\Models\Cocktail; class BarExportCocktails extends Command { diff --git a/app/Console/Commands/BarSearchRefresh.php b/app/Console/Commands/BarSearchRefresh.php index 365f8644..382220d5 100644 --- a/app/Console/Commands/BarSearchRefresh.php +++ b/app/Console/Commands/BarSearchRefresh.php @@ -3,8 +3,8 @@ namespace Kami\Cocktail\Console\Commands; use Illuminate\Console\Command; -use Illuminate\Support\Facades\Artisan; use Kami\Cocktail\SearchActions; +use Illuminate\Support\Facades\Artisan; class BarSearchRefresh extends Command { diff --git a/app/Console/Commands/OpenBar.php b/app/Console/Commands/OpenBar.php index c9da1a70..db0b3795 100644 --- a/app/Console/Commands/OpenBar.php +++ b/app/Console/Commands/OpenBar.php @@ -2,23 +2,23 @@ namespace Kami\Cocktail\Console\Commands; +use Throwable; +use Illuminate\Support\Str; +use Kami\Cocktail\Models\Tag; use Illuminate\Console\Command; -use Illuminate\Database\Eloquent\Model; -use Illuminate\Support\Facades\App; -use Illuminate\Support\Facades\Artisan; +use Kami\Cocktail\Models\Image; +use Kami\Cocktail\SearchActions; +use Symfony\Component\Yaml\Yaml; use Illuminate\Support\Facades\DB; -use Illuminate\Support\Facades\Hash; -use Illuminate\Support\Str; use Kami\Cocktail\Models\Cocktail; -use Kami\Cocktail\Models\CocktailIngredient; -use Kami\Cocktail\Models\CocktailIngredientSubstitute; -use Kami\Cocktail\Models\Image; +use Illuminate\Support\Facades\App; +use Illuminate\Support\Facades\Hash; use Kami\Cocktail\Models\Ingredient; +use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Facades\Artisan; +use Kami\Cocktail\Models\CocktailIngredient; use Kami\Cocktail\Models\IngredientCategory; -use Kami\Cocktail\Models\Tag; -use Kami\Cocktail\SearchActions; -use Symfony\Component\Yaml\Yaml; -use Throwable; +use Kami\Cocktail\Models\CocktailIngredientSubstitute; class OpenBar extends Command { diff --git a/app/Console/Commands/ScrapIBACocktails.php b/app/Console/Commands/ScrapIBACocktails.php index 6419cc88..6b0cb0e8 100644 --- a/app/Console/Commands/ScrapIBACocktails.php +++ b/app/Console/Commands/ScrapIBACocktails.php @@ -2,14 +2,14 @@ namespace Kami\Cocktail\Console\Commands; +use Throwable; use Illuminate\Console\Command; use Illuminate\Support\Facades\Log; -use Symfony\Component\BrowserKit\HttpBrowser; use Symfony\Component\DomCrawler\Crawler; -use Symfony\Component\HttpClient\CachingHttpClient; use Symfony\Component\HttpClient\HttpClient; +use Symfony\Component\BrowserKit\HttpBrowser; use Symfony\Component\HttpKernel\HttpCache\Store; -use Throwable; +use Symfony\Component\HttpClient\CachingHttpClient; class ScrapIBACocktails extends Command { diff --git a/app/Console/Commands/TestScrap.php b/app/Console/Commands/TestScrap.php index 6efb51be..4315162b 100644 --- a/app/Console/Commands/TestScrap.php +++ b/app/Console/Commands/TestScrap.php @@ -3,11 +3,11 @@ namespace Kami\Cocktail\Console\Commands; use Illuminate\Console\Command; -use Symfony\Component\BrowserKit\HttpBrowser; use Symfony\Component\DomCrawler\Crawler; -use Symfony\Component\HttpClient\CachingHttpClient; use Symfony\Component\HttpClient\HttpClient; +use Symfony\Component\BrowserKit\HttpBrowser; use Symfony\Component\HttpKernel\HttpCache\Store; +use Symfony\Component\HttpClient\CachingHttpClient; class TestScrap extends Command { diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 077ae04d..48b9f8dc 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -2,12 +2,12 @@ namespace Kami\Cocktail\Exceptions; -use Illuminate\Database\Eloquent\ModelNotFoundException; +use Throwable; use Illuminate\Database\RecordsNotFoundException; +use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; -use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Throwable; +use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; class Handler extends ExceptionHandler { diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index aa08ee5c..38550fc3 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -5,16 +5,17 @@ namespace Kami\Cocktail\Http\Controllers; use Illuminate\Http\Request; +use Kami\Cocktail\Models\User; +use Kami\Cocktail\SearchActions; +use Illuminate\Http\JsonResponse; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; -use Kami\Cocktail\Http\Requests\RegisterRequest; use Kami\Cocktail\Http\Resources\UserResource; -use Kami\Cocktail\Models\User; -use Kami\Cocktail\SearchActions; +use Kami\Cocktail\Http\Requests\RegisterRequest; class AuthController extends Controller { - public function authenticate(Request $request) + public function authenticate(Request $request): JsonResponse { $credentials = $request->validate([ 'email' => ['required', 'email'], @@ -30,14 +31,14 @@ public function authenticate(Request $request) abort(404, 'User not found. Check your username and password and try again.'); } - public function logout(Request $request) + public function logout(Request $request): JsonResponse { $request->user()->tokens()->delete(); return response()->json(['data' => ['success' => true]]); } - public function register(RegisterRequest $req) + public function register(RegisterRequest $req): JsonResponse { if (config('bar-assistant.allow_registration') == false) { abort(404, 'Registrations are closed.'); diff --git a/app/Http/Controllers/CocktailController.php b/app/Http/Controllers/CocktailController.php index f89016ce..1ba120d3 100644 --- a/app/Http/Controllers/CocktailController.php +++ b/app/Http/Controllers/CocktailController.php @@ -4,14 +4,16 @@ namespace Kami\Cocktail\Http\Controllers; -use Illuminate\Http\JsonResponse; +use Throwable; use Illuminate\Http\Request; +use Illuminate\Http\Response; +use Illuminate\Http\JsonResponse; +use Kami\Cocktail\Models\Cocktail; +use Kami\Cocktail\Services\CocktailService; +use Illuminate\Http\Resources\Json\JsonResource; use Kami\Cocktail\Http\Requests\CocktailRequest; use Kami\Cocktail\Http\Resources\CocktailResource; use Kami\Cocktail\Http\Resources\SuccessActionResource; -use Kami\Cocktail\Models\Cocktail; -use Kami\Cocktail\Services\CocktailService; -use Throwable; class CocktailController extends Controller { @@ -22,7 +24,7 @@ class CocktailController extends Controller * - user_id -> Filter by user id * - favorites -> Filter by user favorites */ - public function index(Request $request) + public function index(Request $request): JsonResource { $cocktails = Cocktail::with('ingredients.ingredient', 'images', 'tags'); @@ -42,7 +44,7 @@ public function index(Request $request) /** * Return a single random cocktail */ - public function random() + public function random(): JsonResource { $cocktail = Cocktail::inRandomOrder() ->firstOrFail() @@ -54,7 +56,7 @@ public function random() /** * Show a single cocktail by it's id or URL slug */ - public function show(int|string $idOrSlug) + public function show(int|string $idOrSlug): JsonResource { $cocktail = Cocktail::where('id', $idOrSlug) ->orWhere('slug', $idOrSlug) @@ -97,7 +99,7 @@ public function store(CocktailService $cocktailService, CocktailRequest $request /** * Update a single cocktail by id */ - public function update(CocktailService $cocktailService, CocktailRequest $request, int $id) + public function update(CocktailService $cocktailService, CocktailRequest $request, int $id): JsonResource { try { $cocktail = $cocktailService->updateCocktail( @@ -125,7 +127,7 @@ public function update(CocktailService $cocktailService, CocktailRequest $reques /** * Delete a single cocktail by id */ - public function delete(int $id) + public function delete(int $id): Response { Cocktail::findOrFail($id)->delete(); @@ -136,7 +138,7 @@ public function delete(int $id) * Show all cocktails that current user can make with * the ingredients he added to his shelf */ - public function userShelf(CocktailService $cocktailService, Request $request) + public function userShelf(CocktailService $cocktailService, Request $request): JsonResource { $cocktails = $cocktailService->getCocktailsByUserIngredients($request->user()->id) ->load('ingredients.ingredient', 'images', 'tags'); @@ -147,7 +149,7 @@ public function userShelf(CocktailService $cocktailService, Request $request) /** * Favorite a cocktail by id */ - public function toggleFavorite(CocktailService $cocktailService, Request $request, int $id) + public function toggleFavorite(CocktailService $cocktailService, Request $request, int $id): JsonResource { $isFavorite = $cocktailService->toggleFavorite($request->user(), $id); @@ -157,7 +159,7 @@ public function toggleFavorite(CocktailService $cocktailService, Request $reques /** * Show all cocktails that current user added to his favorites */ - public function userFavorites(Request $request) + public function userFavorites(Request $request): JsonResource { $cocktails = $request->user()->favorites->pluck('cocktail'); diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 6e2f207e..0e509c2f 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -4,10 +4,10 @@ namespace Kami\Cocktail\Http\Controllers; -use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Illuminate\Foundation\Bus\DispatchesJobs; -use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Routing\Controller as BaseController; +use Illuminate\Foundation\Validation\ValidatesRequests; +use Illuminate\Foundation\Auth\Access\AuthorizesRequests; class Controller extends BaseController { diff --git a/app/Http/Controllers/GlassController.php b/app/Http/Controllers/GlassController.php index 4040241c..975a21cf 100644 --- a/app/Http/Controllers/GlassController.php +++ b/app/Http/Controllers/GlassController.php @@ -4,12 +4,12 @@ namespace Kami\Cocktail\Http\Controllers; -use Illuminate\Http\JsonResponse; -use Illuminate\Http\Resources\Json\JsonResource; use Illuminate\Http\Response; +use Kami\Cocktail\Models\Glass; +use Illuminate\Http\JsonResponse; use Kami\Cocktail\Http\Requests\GlassRequest; use Kami\Cocktail\Http\Resources\GlassResource; -use Kami\Cocktail\Models\Glass; +use Illuminate\Http\Resources\Json\JsonResource; class GlassController extends Controller { diff --git a/app/Http/Controllers/ImageController.php b/app/Http/Controllers/ImageController.php index 583d3026..1fba46d8 100644 --- a/app/Http/Controllers/ImageController.php +++ b/app/Http/Controllers/ImageController.php @@ -5,36 +5,37 @@ namespace Kami\Cocktail\Http\Controllers; use Illuminate\Http\Request; -use Kami\Cocktail\Http\Requests\ImageRequest; -use Kami\Cocktail\Http\Resources\ImageResource; -use Kami\Cocktail\Http\Resources\SuccessActionResource; +use Illuminate\Http\Response; use Kami\Cocktail\Models\Image; use Kami\Cocktail\Services\ImageService; +use Kami\Cocktail\Http\Requests\ImageRequest; +use Kami\Cocktail\Http\Resources\ImageResource; +use Illuminate\Http\Resources\Json\JsonResource; class ImageController extends Controller { - public function show(int $id) + public function show(int $id): JsonResource { $image = Image::findOrFail($id); return new ImageResource($image); } - public function store(ImageService $imageservice, ImageRequest $request) + public function store(ImageService $imageservice, ImageRequest $request): JsonResource { $images = $imageservice->uploadAndSaveImages($request->images); return ImageResource::collection($images); } - public function update(int $id, ImageService $imageservice, Request $request) + public function update(int $id, ImageService $imageservice, Request $request): JsonResource { $image = $imageservice->updateImage($id, null, $request->input('copyright')); return new ImageResource($image); } - public function delete(int $id) + public function delete(int $id): Response { Image::findOrFail($id)->delete(); diff --git a/app/Http/Controllers/IngredientCategoryController.php b/app/Http/Controllers/IngredientCategoryController.php index bd57201b..4fea2823 100644 --- a/app/Http/Controllers/IngredientCategoryController.php +++ b/app/Http/Controllers/IngredientCategoryController.php @@ -4,28 +4,30 @@ namespace Kami\Cocktail\Http\Controllers; +use Illuminate\Http\Response; +use Illuminate\Http\JsonResponse; +use Kami\Cocktail\Models\IngredientCategory; +use Illuminate\Http\Resources\Json\JsonResource; use Kami\Cocktail\Http\Requests\IngredientCategoryRequest; use Kami\Cocktail\Http\Resources\IngredientCategoryResource; -use Kami\Cocktail\Http\Resources\SuccessActionResource; -use Kami\Cocktail\Models\IngredientCategory; class IngredientCategoryController extends Controller { - public function index() + public function index(): JsonResource { $categories = IngredientCategory::all(); return IngredientCategoryResource::collection($categories); } - public function show(int $id) + public function show(int $id): JsonResource { $category = IngredientCategory::findOrFail($id); return new IngredientCategoryResource($category); } - public function store(IngredientCategoryRequest $request) + public function store(IngredientCategoryRequest $request): JsonResponse { $category = new IngredientCategory(); $category->name = $request->post('name'); @@ -38,7 +40,7 @@ public function store(IngredientCategoryRequest $request) ->header('Location', route('ingredient-categories.show', $category->id)); } - public function update(IngredientCategoryRequest $request, int $id) + public function update(IngredientCategoryRequest $request, int $id): JsonResource { $category = IngredientCategory::findOrFail($id); $category->name = $request->post('name'); @@ -48,7 +50,7 @@ public function update(IngredientCategoryRequest $request, int $id) return new IngredientCategoryResource($category); } - public function delete(int $id) + public function delete(int $id): Response { IngredientCategory::findOrFail($id)->delete(); diff --git a/app/Http/Controllers/IngredientController.php b/app/Http/Controllers/IngredientController.php index 45720564..87f64c4e 100644 --- a/app/Http/Controllers/IngredientController.php +++ b/app/Http/Controllers/IngredientController.php @@ -5,15 +5,17 @@ namespace Kami\Cocktail\Http\Controllers; use Illuminate\Http\Request; -use Kami\Cocktail\Http\Requests\IngredientRequest; -use Kami\Cocktail\Http\Resources\IngredientResource; -use Kami\Cocktail\Http\Resources\SuccessActionResource; +use Illuminate\Http\Response; +use Illuminate\Http\JsonResponse; use Kami\Cocktail\Models\Ingredient; use Kami\Cocktail\Services\IngredientService; +use Illuminate\Http\Resources\Json\JsonResource; +use Kami\Cocktail\Http\Requests\IngredientRequest; +use Kami\Cocktail\Http\Resources\IngredientResource; class IngredientController extends Controller { - public function index(Request $request) + public function index(Request $request): JsonResource { $ingredients = Ingredient::with('category', 'images') ->orderBy('name') @@ -32,7 +34,7 @@ public function index(Request $request) return IngredientResource::collection($ingredients->get()); } - public function show(int|string $id) + public function show(int|string $id): JsonResource { $ingredient = Ingredient::with('cocktails', 'images', 'varieties', 'parentIngredient') ->where('id', $id) @@ -42,7 +44,7 @@ public function show(int|string $id) return new IngredientResource($ingredient); } - public function store(IngredientService $ingredientService, IngredientRequest $request) + public function store(IngredientService $ingredientService, IngredientRequest $request): JsonResponse { $ingredient = $ingredientService->createIngredient( $request->post('name'), @@ -62,7 +64,7 @@ public function store(IngredientService $ingredientService, IngredientRequest $r ->header('Location', route('ingredients.show', $ingredient->id)); } - public function update(IngredientService $ingredientService, IngredientRequest $request, int $id) + public function update(IngredientService $ingredientService, IngredientRequest $request, int $id): JsonResource { $ingredient = $ingredientService->updateIngredient( $id, @@ -80,7 +82,7 @@ public function update(IngredientService $ingredientService, IngredientRequest $ return new IngredientResource($ingredient); } - public function delete(int $id) + public function delete(int $id): Response { Ingredient::findOrFail($id)->delete(); diff --git a/app/Http/Controllers/ServerController.php b/app/Http/Controllers/ServerController.php index 32227800..5c49ae13 100644 --- a/app/Http/Controllers/ServerController.php +++ b/app/Http/Controllers/ServerController.php @@ -4,18 +4,20 @@ namespace Kami\Cocktail\Http\Controllers; +use Illuminate\Http\Response; use Laravel\Scout\EngineManager; +use Illuminate\Http\JsonResponse; class ServerController extends Controller { - public function index() + public function index(): JsonResponse { return response()->json([ 'status' => 'available' ]); } - public function version(EngineManager $engine) + public function version(EngineManager $engine): JsonResponse { /** @var \MeiliSearch\Client */ $meilisearch = $engine->engine(); @@ -30,7 +32,7 @@ public function version(EngineManager $engine) ]); } - public function openApi() + public function openApi(): Response { return response( file_get_contents(base_path('docs/open-api-spec.yml')), diff --git a/app/Http/Controllers/ShelfController.php b/app/Http/Controllers/ShelfController.php index 30e7c348..c3110db9 100644 --- a/app/Http/Controllers/ShelfController.php +++ b/app/Http/Controllers/ShelfController.php @@ -4,23 +4,26 @@ namespace Kami\Cocktail\Http\Controllers; +use Throwable; use Illuminate\Http\Request; -use Kami\Cocktail\Http\Requests\UserIngredientBatchRequest; -use Kami\Cocktail\Http\Resources\UserIngredientResource; +use Illuminate\Http\Response; +use Illuminate\Http\JsonResponse; use Kami\Cocktail\Models\UserIngredient; use Kami\Cocktail\Models\UserShoppingList; -use Throwable; +use Illuminate\Http\Resources\Json\JsonResource; +use Kami\Cocktail\Http\Resources\UserIngredientResource; +use Kami\Cocktail\Http\Requests\UserIngredientBatchRequest; class ShelfController extends Controller { - public function index(Request $request) + public function index(Request $request): JsonResource { $userIngredients = $request->user()->shelfIngredients; return UserIngredientResource::collection($userIngredients); } - public function save(Request $request, int $ingredientId) + public function save(Request $request, int $ingredientId): JsonResponse { // Remove ingredient from the shopping list if it exists UserShoppingList::where('ingredient_id', $ingredientId)->delete(); @@ -37,7 +40,7 @@ public function save(Request $request, int $ingredientId) return (new UserIngredientResource($shelfIngredient))->response()->setStatusCode(200); } - public function batch(UserIngredientBatchRequest $request) + public function batch(UserIngredientBatchRequest $request): JsonResource { $ingredientIds = $request->post('ingredient_ids'); @@ -56,7 +59,7 @@ public function batch(UserIngredientBatchRequest $request) return UserIngredientResource::collection($si); } - public function delete(Request $request, int $ingredientId) + public function delete(Request $request, int $ingredientId): Response { try { UserIngredient::where('user_id', $request->user()->id) diff --git a/app/Http/Controllers/ShoppingListController.php b/app/Http/Controllers/ShoppingListController.php index 36a37bb3..291bc450 100644 --- a/app/Http/Controllers/ShoppingListController.php +++ b/app/Http/Controllers/ShoppingListController.php @@ -4,12 +4,12 @@ namespace Kami\Cocktail\Http\Controllers; +use Throwable; use Illuminate\Http\Request; +use Kami\Cocktail\Models\UserShoppingList; use Illuminate\Http\Resources\Json\JsonResource; use Kami\Cocktail\Http\Resources\SuccessActionResource; use Kami\Cocktail\Http\Resources\UserShoppingListResource; -use Kami\Cocktail\Models\UserShoppingList; -use Throwable; class ShoppingListController extends Controller { diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 3677f97e..6684fc41 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -6,10 +6,11 @@ use Illuminate\Http\Request; use Kami\Cocktail\Http\Resources\UserResource; +use Illuminate\Http\Resources\Json\JsonResource; class UserController extends Controller { - public function show(Request $request) + public function show(Request $request): JsonResource { return new UserResource( $request->user()->load('favorites', 'shelfIngredients', 'shoppingLists') diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index 947b9992..f42a2d42 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -2,8 +2,8 @@ namespace Kami\Cocktail\Http\Middleware; -use Illuminate\Http\Middleware\TrustProxies as Middleware; use Illuminate\Http\Request; +use Illuminate\Http\Middleware\TrustProxies as Middleware; class TrustProxies extends Middleware { diff --git a/app/Http/Resources/CocktailIngredientResource.php b/app/Http/Resources/CocktailIngredientResource.php index 235fdc53..e69ebedd 100644 --- a/app/Http/Resources/CocktailIngredientResource.php +++ b/app/Http/Resources/CocktailIngredientResource.php @@ -15,7 +15,7 @@ class CocktailIngredientResource extends JsonResource * Transform the resource into an array. * * @param \Illuminate\Http\Request $request - * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable + * @return array */ public function toArray($request) { diff --git a/app/Http/Resources/CocktailIngredientSubstituteResource.php b/app/Http/Resources/CocktailIngredientSubstituteResource.php index 2d3710da..84ba7368 100644 --- a/app/Http/Resources/CocktailIngredientSubstituteResource.php +++ b/app/Http/Resources/CocktailIngredientSubstituteResource.php @@ -15,7 +15,7 @@ class CocktailIngredientSubstituteResource extends JsonResource * Transform the resource into an array. * * @param \Illuminate\Http\Request $request - * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable + * @return array */ public function toArray($request) { diff --git a/app/Http/Resources/CocktailResource.php b/app/Http/Resources/CocktailResource.php index 18dac091..62ed979c 100644 --- a/app/Http/Resources/CocktailResource.php +++ b/app/Http/Resources/CocktailResource.php @@ -15,7 +15,7 @@ class CocktailResource extends JsonResource * Transform the resource into an array. * * @param \Illuminate\Http\Request $request - * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable + * @return array */ public function toArray($request) { diff --git a/app/Http/Resources/ErrorResource.php b/app/Http/Resources/ErrorResource.php index 87aca1f2..2012c9b6 100644 --- a/app/Http/Resources/ErrorResource.php +++ b/app/Http/Resources/ErrorResource.php @@ -15,7 +15,7 @@ class ErrorResource extends JsonResource * Transform the resource into an array. * * @param \Illuminate\Http\Request $request - * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable + * @return array */ public function toArray($request) { diff --git a/app/Http/Resources/GlassResource.php b/app/Http/Resources/GlassResource.php index 5f4fab3b..1c080323 100644 --- a/app/Http/Resources/GlassResource.php +++ b/app/Http/Resources/GlassResource.php @@ -15,7 +15,7 @@ class GlassResource extends JsonResource * Transform the resource into an array. * * @param \Illuminate\Http\Request $request - * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable + * @return array */ public function toArray($request) { diff --git a/app/Http/Resources/ImageResource.php b/app/Http/Resources/ImageResource.php index e76e3484..ba7a3939 100644 --- a/app/Http/Resources/ImageResource.php +++ b/app/Http/Resources/ImageResource.php @@ -4,8 +4,8 @@ namespace Kami\Cocktail\Http\Resources; -use Illuminate\Http\Resources\Json\JsonResource; use Illuminate\Support\Facades\Storage; +use Illuminate\Http\Resources\Json\JsonResource; /** * @mixin \Kami\Cocktail\Models\Image @@ -16,7 +16,7 @@ class ImageResource extends JsonResource * Transform the resource into an array. * * @param \Illuminate\Http\Request $request - * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable + * @return array */ public function toArray($request) { diff --git a/app/Http/Resources/IngredientCategoryResource.php b/app/Http/Resources/IngredientCategoryResource.php index 7dba497c..50c4eca3 100644 --- a/app/Http/Resources/IngredientCategoryResource.php +++ b/app/Http/Resources/IngredientCategoryResource.php @@ -15,7 +15,7 @@ class IngredientCategoryResource extends JsonResource * Transform the resource into an array. * * @param \Illuminate\Http\Request $request - * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable + * @return array */ public function toArray($request) { diff --git a/app/Http/Resources/IngredientResource.php b/app/Http/Resources/IngredientResource.php index bc0c5411..c693a407 100644 --- a/app/Http/Resources/IngredientResource.php +++ b/app/Http/Resources/IngredientResource.php @@ -15,7 +15,7 @@ class IngredientResource extends JsonResource * Transform the resource into an array. * * @param \Illuminate\Http\Request $request - * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable + * @return array */ public function toArray($request) { diff --git a/app/Http/Resources/SuccessActionResource.php b/app/Http/Resources/SuccessActionResource.php index 6c9f7558..036d424a 100644 --- a/app/Http/Resources/SuccessActionResource.php +++ b/app/Http/Resources/SuccessActionResource.php @@ -12,7 +12,7 @@ class SuccessActionResource extends JsonResource * Transform the resource into an array. * * @param \Illuminate\Http\Request $request - * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable + * @return array */ public function toArray($request) { diff --git a/app/Http/Resources/UserIngredientResource.php b/app/Http/Resources/UserIngredientResource.php index b3bc8ed4..a1f6ee67 100644 --- a/app/Http/Resources/UserIngredientResource.php +++ b/app/Http/Resources/UserIngredientResource.php @@ -15,7 +15,7 @@ class UserIngredientResource extends JsonResource * Transform the resource into an array. * * @param \Illuminate\Http\Request $request - * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable + * @return array */ public function toArray($request) { diff --git a/app/Http/Resources/UserResource.php b/app/Http/Resources/UserResource.php index c61fc4da..ef6214e5 100644 --- a/app/Http/Resources/UserResource.php +++ b/app/Http/Resources/UserResource.php @@ -15,7 +15,7 @@ class UserResource extends JsonResource * Transform the resource into an array. * * @param \Illuminate\Http\Request $request - * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable + * @return array */ public function toArray($request) { diff --git a/app/Http/Resources/UserShoppingListResource.php b/app/Http/Resources/UserShoppingListResource.php index fa2e1828..1ee59104 100644 --- a/app/Http/Resources/UserShoppingListResource.php +++ b/app/Http/Resources/UserShoppingListResource.php @@ -15,7 +15,7 @@ class UserShoppingListResource extends JsonResource * Transform the resource into an array. * * @param \Illuminate\Http\Request $request - * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable + * @return array */ public function toArray($request) { diff --git a/app/Models/Cocktail.php b/app/Models/Cocktail.php index d7a93aa0..95b0ac94 100644 --- a/app/Models/Cocktail.php +++ b/app/Models/Cocktail.php @@ -4,15 +4,15 @@ namespace Kami\Cocktail\Models; -use Illuminate\Database\Eloquent\Factories\HasFactory; -use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Relations\BelongsTo; -use Illuminate\Database\Eloquent\Relations\BelongsToMany; -use Illuminate\Database\Eloquent\Relations\HasMany; -use Kami\Cocktail\SearchActions; use Laravel\Scout\Searchable; use Spatie\Sluggable\HasSlug; +use Kami\Cocktail\SearchActions; use Spatie\Sluggable\SlugOptions; +use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; class Cocktail extends Model implements SiteSearchable { diff --git a/app/Models/CocktailFavorite.php b/app/Models/CocktailFavorite.php index 6170cc57..1a6e14cb 100644 --- a/app/Models/CocktailFavorite.php +++ b/app/Models/CocktailFavorite.php @@ -4,9 +4,9 @@ namespace Kami\Cocktail\Models; -use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; class CocktailFavorite extends Model { diff --git a/app/Models/CocktailIngredient.php b/app/Models/CocktailIngredient.php index f78609bb..a0bd89f7 100644 --- a/app/Models/CocktailIngredient.php +++ b/app/Models/CocktailIngredient.php @@ -4,10 +4,10 @@ namespace Kami\Cocktail\Models; -use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; class CocktailIngredient extends Model { diff --git a/app/Models/CocktailIngredientSubstitute.php b/app/Models/CocktailIngredientSubstitute.php index 1f2c991a..7ac12636 100644 --- a/app/Models/CocktailIngredientSubstitute.php +++ b/app/Models/CocktailIngredientSubstitute.php @@ -4,9 +4,9 @@ namespace Kami\Cocktail\Models; -use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; class CocktailIngredientSubstitute extends Model { diff --git a/app/Models/Glass.php b/app/Models/Glass.php index f4f6d3dc..2c2d5429 100644 --- a/app/Models/Glass.php +++ b/app/Models/Glass.php @@ -4,8 +4,8 @@ namespace Kami\Cocktail\Models; -use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Factories\HasFactory; class Glass extends Model { diff --git a/app/Models/HasImages.php b/app/Models/HasImages.php index 2fef79a6..81807b6d 100644 --- a/app/Models/HasImages.php +++ b/app/Models/HasImages.php @@ -4,10 +4,10 @@ namespace Kami\Cocktail\Models; +use Illuminate\Support\Str; +use Illuminate\Support\Facades\Storage; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Relations\MorphMany; -use Illuminate\Support\Facades\Storage; -use Illuminate\Support\Str; trait HasImages { diff --git a/app/Models/Image.php b/app/Models/Image.php index b4b316b9..f0c28036 100644 --- a/app/Models/Image.php +++ b/app/Models/Image.php @@ -4,10 +4,10 @@ namespace Kami\Cocktail\Models; -use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Relations\MorphTo; use Illuminate\Support\Facades\Storage; +use Illuminate\Database\Eloquent\Relations\MorphTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; class Image extends Model { diff --git a/app/Models/Ingredient.php b/app/Models/Ingredient.php index 47b5dc52..17424cf1 100644 --- a/app/Models/Ingredient.php +++ b/app/Models/Ingredient.php @@ -4,16 +4,16 @@ namespace Kami\Cocktail\Models; -use Illuminate\Database\Eloquent\Factories\HasFactory; -use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Relations\BelongsTo; -use Illuminate\Database\Eloquent\Relations\BelongsToMany; -use Illuminate\Database\Eloquent\Relations\HasMany; -use Illuminate\Support\Collection; -use Kami\Cocktail\SearchActions; use Laravel\Scout\Searchable; use Spatie\Sluggable\HasSlug; +use Kami\Cocktail\SearchActions; use Spatie\Sluggable\SlugOptions; +use Illuminate\Support\Collection; +use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; class Ingredient extends Model implements SiteSearchable { diff --git a/app/Models/IngredientCategory.php b/app/Models/IngredientCategory.php index 2d823b5d..579d881c 100644 --- a/app/Models/IngredientCategory.php +++ b/app/Models/IngredientCategory.php @@ -4,8 +4,8 @@ namespace Kami\Cocktail\Models; -use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Factories\HasFactory; class IngredientCategory extends Model { diff --git a/app/Models/Tag.php b/app/Models/Tag.php index 5179c0b4..e9779b45 100644 --- a/app/Models/Tag.php +++ b/app/Models/Tag.php @@ -4,8 +4,8 @@ namespace Kami\Cocktail\Models; -use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Factories\HasFactory; class Tag extends Model { diff --git a/app/Models/User.php b/app/Models/User.php index 974b8c86..28b6e2b4 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -5,12 +5,12 @@ namespace Kami\Cocktail\Models; // use Illuminate\Contracts\Auth\MustVerifyEmail; -use Illuminate\Database\Eloquent\Factories\HasFactory; +use Laravel\Sanctum\HasApiTokens; +use Illuminate\Notifications\Notifiable; use Illuminate\Database\Eloquent\Relations\HasMany; -use Illuminate\Database\Eloquent\Relations\HasManyThrough; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; -use Illuminate\Notifications\Notifiable; -use Laravel\Sanctum\HasApiTokens; +use Illuminate\Database\Eloquent\Relations\HasManyThrough; class User extends Authenticatable { diff --git a/app/Models/UserIngredient.php b/app/Models/UserIngredient.php index 5ce1610d..c7f6a0fe 100644 --- a/app/Models/UserIngredient.php +++ b/app/Models/UserIngredient.php @@ -4,8 +4,8 @@ namespace Kami\Cocktail\Models; -use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Factories\HasFactory; class UserIngredient extends Model { diff --git a/app/Models/UserShoppingList.php b/app/Models/UserShoppingList.php index f195ca93..ae2e8a35 100644 --- a/app/Models/UserShoppingList.php +++ b/app/Models/UserShoppingList.php @@ -4,9 +4,9 @@ namespace Kami\Cocktail\Models; -use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; class UserShoppingList extends Model { diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index 98059ac5..787316be 100644 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -2,8 +2,8 @@ namespace Kami\Cocktail\Providers; -use Illuminate\Support\Facades\Broadcast; use Illuminate\Support\ServiceProvider; +use Illuminate\Support\Facades\Broadcast; class BroadcastServiceProvider extends ServiceProvider { diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 0ebbc796..40b5543c 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -2,10 +2,10 @@ namespace Kami\Cocktail\Providers; +use Illuminate\Support\Facades\Event; use Illuminate\Auth\Events\Registered; use Illuminate\Auth\Listeners\SendEmailVerificationNotification; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -use Illuminate\Support\Facades\Event; class EventServiceProvider extends ServiceProvider { diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 48d049a6..a86dd094 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -2,11 +2,11 @@ namespace Kami\Cocktail\Providers; -use Illuminate\Cache\RateLimiting\Limit; -use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Http\Request; -use Illuminate\Support\Facades\RateLimiter; use Illuminate\Support\Facades\Route; +use Illuminate\Cache\RateLimiting\Limit; +use Illuminate\Support\Facades\RateLimiter; +use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; class RouteServiceProvider extends ServiceProvider { diff --git a/app/Scraper/Scraper.php b/app/Scraper/Scraper.php index 23f26d6e..3c4959e1 100644 --- a/app/Scraper/Scraper.php +++ b/app/Scraper/Scraper.php @@ -4,11 +4,11 @@ namespace Kami\Cocktail\Scraper; -use Symfony\Component\BrowserKit\HttpBrowser; use Symfony\Component\DomCrawler\Crawler; -use Symfony\Component\HttpClient\CachingHttpClient; use Symfony\Component\HttpClient\HttpClient; +use Symfony\Component\BrowserKit\HttpBrowser; use Symfony\Component\HttpKernel\HttpCache\Store; +use Symfony\Component\HttpClient\CachingHttpClient; class Scraper { diff --git a/app/Services/CocktailService.php b/app/Services/CocktailService.php index b1553309..07d595fd 100644 --- a/app/Services/CocktailService.php +++ b/app/Services/CocktailService.php @@ -4,18 +4,18 @@ namespace Kami\Cocktail\Services; -use Illuminate\Database\DatabaseManager; +use Throwable; +use Kami\Cocktail\Models\Tag; use Illuminate\Log\LogManager; +use Kami\Cocktail\Models\User; +use Kami\Cocktail\Models\Image; use Illuminate\Support\Collection; -use Kami\Cocktail\Exceptions\CocktailException; use Kami\Cocktail\Models\Cocktail; +use Illuminate\Database\DatabaseManager; use Kami\Cocktail\Models\CocktailFavorite; use Kami\Cocktail\Models\CocktailIngredient; +use Kami\Cocktail\Exceptions\CocktailException; use Kami\Cocktail\Models\CocktailIngredientSubstitute; -use Kami\Cocktail\Models\Image; -use Kami\Cocktail\Models\Tag; -use Kami\Cocktail\Models\User; -use Throwable; class CocktailService { @@ -30,7 +30,7 @@ public function __construct( * * @param string $name * @param string $instructions - * @param array $ingredients + * @param array $ingredients * @param int $userId * @param string|null $description * @param string|null $garnish @@ -129,7 +129,7 @@ public function createCocktail( * @param int $id * @param string $name * @param string $instructions - * @param array $ingredients + * @param array $ingredients * @param int $userId * @param string|null $description * @param string|null $garnish @@ -234,7 +234,7 @@ public function updateCocktail( * ingredients in his shelf * * @param int $userId - * @return \Illuminate\Database\Eloquent\Collection<\Kami\Cocktail\Models\Cocktail> + * @return \Illuminate\Database\Eloquent\Collection */ public function getCocktailsByUserIngredients(int $userId): Collection { diff --git a/app/Services/ImageService.php b/app/Services/ImageService.php index 3e4c2638..237a3704 100644 --- a/app/Services/ImageService.php +++ b/app/Services/ImageService.php @@ -4,10 +4,10 @@ namespace Kami\Cocktail\Services; -use Illuminate\Http\UploadedFile; use Illuminate\Support\Str; -use Kami\Cocktail\Exceptions\ImageUploadException; use Kami\Cocktail\Models\Image; +use Illuminate\Http\UploadedFile; +use Kami\Cocktail\Exceptions\ImageUploadException; class ImageService { diff --git a/app/Services/IngredientService.php b/app/Services/IngredientService.php index 82df6bb8..7f88d5dd 100644 --- a/app/Services/IngredientService.php +++ b/app/Services/IngredientService.php @@ -4,11 +4,11 @@ namespace Kami\Cocktail\Services; -use Kami\Cocktail\Exceptions\ImageException; -use Kami\Cocktail\Exceptions\IngredientException; +use Throwable; use Kami\Cocktail\Models\Image; use Kami\Cocktail\Models\Ingredient; -use Throwable; +use Kami\Cocktail\Exceptions\ImageException; +use Kami\Cocktail\Exceptions\IngredientException; class IngredientService { diff --git a/config/bar-assistant.php b/config/bar-assistant.php index c2fb52b1..82620f10 100644 --- a/config/bar-assistant.php +++ b/config/bar-assistant.php @@ -11,7 +11,7 @@ | */ - 'version' => 'v0.5.3', + 'version' => 'v1.0.0', /* |-------------------------------------------------------------------------- diff --git a/ecs.php b/ecs.php index 5244bc85..76bac434 100644 --- a/ecs.php +++ b/ecs.php @@ -1,5 +1,6 @@ paths([__DIR__ . '/app', __DIR__ . '/tests']); $ecsConfig->sets([SetList::PSR_12]); + + $ecsConfig->ruleWithConfiguration(OrderedImportsFixer::class, [ + 'sort_algorithm' => 'length' + ]); }; diff --git a/resources/data/popular_cocktails.yml b/resources/data/popular_cocktails.yml index a11be38d..1eb9e5cc 100644 --- a/resources/data/popular_cocktails.yml +++ b/resources/data/popular_cocktails.yml @@ -682,3 +682,63 @@ units: teaspoon name: 'Grenadine Syrup' optional: false +- + name: Štrukani Pelin + description: Štrukani pelinkovac (or štrukani pelin) is a somewhat novel Croatian drink that combines pelinkovac (traditional herbal liqueur) with lemon juice. In its basic form, the drink is made with pelinkovac that is poured into an ice-filled glass. + instructions: |- + 1. A lemon slice is then squeezed directly into the glass and mixed. + + The amount of lemon juice can vary, sometimes resulting in a drink with equal amounts of both ingredients. More elaborate versions often add orange juice, citrus zest, or spices. + garnish: Lemon wedge + source: 'https://www.journal.hr/lifestyle/gastro/antique-pelinkovac-strukani-pelin-jesenski-koktel-cool-pice/' + image_copyright: Tasteatlas + tags: [] + glass: Lowball + ingredients: + - + amount: 30 + units: ml + name: Pelinkovac + optional: false + - + amount: 15 + units: ml + name: 'Lemon Juice' + optional: false + - + amount: 50 + units: ml + name: 'Tonic' + optional: true +- + name: Antikovac + description: null + instructions: |- + 1. Shake all the ingredients + 2. Strain into a lowball glass + garnish: Orange zest + source: 'https://www.journal.hr/lifestyle/gastro/antique-pelinkovac-strukani-pelin-jesenski-koktel-cool-pice/' + image_copyright: Tasteatlas + tags: [] + glass: Lowball + ingredients: + - + amount: 50 + units: ml + name: Pelinkovac + optional: false + - + amount: 20 + units: ml + name: 'Orgeat syrup' + optional: false + - + amount: 10 + units: ml + name: 'Lemon juice' + optional: false + - + amount: 50 + units: ml + name: 'Orange juice' + optional: false diff --git a/resources/entrypoint.sh b/resources/entrypoint.sh index 60e2db75..ff963c69 100644 --- a/resources/entrypoint.sh +++ b/resources/entrypoint.sh @@ -2,7 +2,7 @@ set -e -system_start_checkup() { +first_time_check() { if [ ! -f /var/www/cocktails/.env ]; then echo "Application .env file not found, creating a new .env file..." @@ -22,20 +22,18 @@ system_start_checkup() { echo "Database already exists, running migrations..." php artisan migrate --force fi - - php artisan config:cache - php artisan route:cache - - # echo "Setting permissions..." - - # chown -R www-data:www-data /var/www/cocktails - - echo "Application ready!" fi } start_system() { - system_start_checkup + first_time_check + + echo "Adding routes and config to cache..." + + php artisan config:cache + php artisan route:cache + + echo "Application ready!" } start_system diff --git a/storage/uploads/cocktails/antikovac.jpg b/storage/uploads/cocktails/antikovac.jpg new file mode 100644 index 00000000..8599baaa Binary files /dev/null and b/storage/uploads/cocktails/antikovac.jpg differ diff --git a/storage/uploads/cocktails/strukani-pelin.jpg b/storage/uploads/cocktails/strukani-pelin.jpg new file mode 100644 index 00000000..b8daaf79 Binary files /dev/null and b/storage/uploads/cocktails/strukani-pelin.jpg differ diff --git a/tests/Feature/AuthControllerTest.php b/tests/Feature/AuthControllerTest.php index 240d4ebb..0dc9f4fa 100644 --- a/tests/Feature/AuthControllerTest.php +++ b/tests/Feature/AuthControllerTest.php @@ -2,11 +2,11 @@ namespace Tests\Feature; -use Illuminate\Foundation\Testing\RefreshDatabase; -use Illuminate\Support\Facades\Hash; -use Kami\Cocktail\Models\User; -use Spectator\Spectator; use Tests\TestCase; +use Spectator\Spectator; +use Kami\Cocktail\Models\User; +use Illuminate\Support\Facades\Hash; +use Illuminate\Foundation\Testing\RefreshDatabase; class AuthControllerTest extends TestCase { diff --git a/tests/Feature/CocktailControllerTest.php b/tests/Feature/CocktailControllerTest.php index 694289d4..6ad1877d 100644 --- a/tests/Feature/CocktailControllerTest.php +++ b/tests/Feature/CocktailControllerTest.php @@ -2,13 +2,13 @@ namespace Tests\Feature; -use Illuminate\Foundation\Testing\RefreshDatabase; -use Illuminate\Testing\Fluent\AssertableJson; +use Tests\TestCase; +use Spectator\Spectator; +use Kami\Cocktail\Models\User; use Kami\Cocktail\Models\Cocktail; use Kami\Cocktail\Models\Ingredient; -use Kami\Cocktail\Models\User; -use Spectator\Spectator; -use Tests\TestCase; +use Illuminate\Testing\Fluent\AssertableJson; +use Illuminate\Foundation\Testing\RefreshDatabase; class CocktailControllerTest extends TestCase { diff --git a/tests/Feature/GlassControllerTest.php b/tests/Feature/GlassControllerTest.php index f9305233..b9e99ec7 100644 --- a/tests/Feature/GlassControllerTest.php +++ b/tests/Feature/GlassControllerTest.php @@ -4,12 +4,12 @@ namespace Tests\Feature; -use Illuminate\Foundation\Testing\RefreshDatabase; -use Illuminate\Testing\Fluent\AssertableJson; -use Kami\Cocktail\Models\Glass; -use Kami\Cocktail\Models\User; -use Spectator\Spectator; use Tests\TestCase; +use Spectator\Spectator; +use Kami\Cocktail\Models\User; +use Kami\Cocktail\Models\Glass; +use Illuminate\Testing\Fluent\AssertableJson; +use Illuminate\Foundation\Testing\RefreshDatabase; class GlassControllerTest extends TestCase { diff --git a/tests/Feature/ImageControllerTest.php b/tests/Feature/ImageControllerTest.php index 109556c7..0a821b19 100644 --- a/tests/Feature/ImageControllerTest.php +++ b/tests/Feature/ImageControllerTest.php @@ -2,12 +2,12 @@ namespace Tests\Feature; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Tests\TestCase; +use Kami\Cocktail\Models\User; use Illuminate\Http\UploadedFile; use Illuminate\Support\Facades\Storage; use Illuminate\Testing\Fluent\AssertableJson; -use Kami\Cocktail\Models\User; -use Tests\TestCase; +use Illuminate\Foundation\Testing\RefreshDatabase; class ImageControllerTest extends TestCase { diff --git a/tests/Feature/IngredientCategoryControllerTest.php b/tests/Feature/IngredientCategoryControllerTest.php index fca5525a..aff9403b 100644 --- a/tests/Feature/IngredientCategoryControllerTest.php +++ b/tests/Feature/IngredientCategoryControllerTest.php @@ -4,12 +4,12 @@ namespace Tests\Feature; -use Illuminate\Foundation\Testing\RefreshDatabase; -use Illuminate\Testing\Fluent\AssertableJson; -use Kami\Cocktail\Models\IngredientCategory; -use Kami\Cocktail\Models\User; -use Spectator\Spectator; use Tests\TestCase; +use Spectator\Spectator; +use Kami\Cocktail\Models\User; +use Kami\Cocktail\Models\IngredientCategory; +use Illuminate\Testing\Fluent\AssertableJson; +use Illuminate\Foundation\Testing\RefreshDatabase; class IngredientCategoryControllerTest extends TestCase { diff --git a/tests/Feature/IngredientControllerTest.php b/tests/Feature/IngredientControllerTest.php index d46409cd..78db2e59 100644 --- a/tests/Feature/IngredientControllerTest.php +++ b/tests/Feature/IngredientControllerTest.php @@ -4,13 +4,13 @@ namespace Tests\Feature; -use Illuminate\Foundation\Testing\RefreshDatabase; -use Illuminate\Testing\Fluent\AssertableJson; +use Tests\TestCase; +use Spectator\Spectator; +use Kami\Cocktail\Models\User; use Kami\Cocktail\Models\Ingredient; use Kami\Cocktail\Models\IngredientCategory; -use Kami\Cocktail\Models\User; -use Spectator\Spectator; -use Tests\TestCase; +use Illuminate\Testing\Fluent\AssertableJson; +use Illuminate\Foundation\Testing\RefreshDatabase; class IngredientControllerTest extends TestCase { diff --git a/tests/Feature/ServerControllerTest.php b/tests/Feature/ServerControllerTest.php index 7768331a..1adbf30b 100644 --- a/tests/Feature/ServerControllerTest.php +++ b/tests/Feature/ServerControllerTest.php @@ -3,8 +3,8 @@ namespace Tests\Feature; // use Illuminate\Foundation\Testing\RefreshDatabase; -use Spectator\Spectator; use Tests\TestCase; +use Spectator\Spectator; class ServerControllerTest extends TestCase { diff --git a/tests/Feature/ShelfControllerTest.php b/tests/Feature/ShelfControllerTest.php index 47458ad5..f98ab8fd 100644 --- a/tests/Feature/ShelfControllerTest.php +++ b/tests/Feature/ShelfControllerTest.php @@ -4,13 +4,13 @@ namespace Tests\Feature; -use Illuminate\Foundation\Testing\RefreshDatabase; -use Illuminate\Testing\Fluent\AssertableJson; -use Kami\Cocktail\Models\Ingredient; +use Tests\TestCase; +use Spectator\Spectator; use Kami\Cocktail\Models\User; +use Kami\Cocktail\Models\Ingredient; use Kami\Cocktail\Models\UserIngredient; -use Spectator\Spectator; -use Tests\TestCase; +use Illuminate\Testing\Fluent\AssertableJson; +use Illuminate\Foundation\Testing\RefreshDatabase; class ShelfControllerTest extends TestCase { diff --git a/tests/Feature/ShoppingListControllerTest.php b/tests/Feature/ShoppingListControllerTest.php index 6a4c1022..ca8e5c28 100644 --- a/tests/Feature/ShoppingListControllerTest.php +++ b/tests/Feature/ShoppingListControllerTest.php @@ -4,13 +4,13 @@ namespace Tests\Feature; -use Illuminate\Foundation\Testing\RefreshDatabase; -use Illuminate\Testing\Fluent\AssertableJson; -use Kami\Cocktail\Models\Ingredient; +use Tests\TestCase; +use Spectator\Spectator; use Kami\Cocktail\Models\User; +use Kami\Cocktail\Models\Ingredient; use Kami\Cocktail\Models\UserShoppingList; -use Spectator\Spectator; -use Tests\TestCase; +use Illuminate\Testing\Fluent\AssertableJson; +use Illuminate\Foundation\Testing\RefreshDatabase; class ShoppingListControllerTest extends TestCase { diff --git a/tests/Feature/UserControllerTest.php b/tests/Feature/UserControllerTest.php index d9023b33..e735682f 100644 --- a/tests/Feature/UserControllerTest.php +++ b/tests/Feature/UserControllerTest.php @@ -4,11 +4,11 @@ namespace Tests\Feature; -use Illuminate\Foundation\Testing\RefreshDatabase; -use Illuminate\Testing\Fluent\AssertableJson; -use Kami\Cocktail\Models\User; -use Spectator\Spectator; use Tests\TestCase; +use Spectator\Spectator; +use Kami\Cocktail\Models\User; +use Illuminate\Testing\Fluent\AssertableJson; +use Illuminate\Foundation\Testing\RefreshDatabase; class UserControllerTest extends TestCase {