-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from karlomikus/develop
Merge next version
- Loading branch information
Showing
46 changed files
with
1,121 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# v0.3.0 | ||
- Move "Uncategorized" ingredient category to id: 1 | ||
- Cocktail save/update methods now save glass type | ||
- Update docker entrypoint with better up/down handling | ||
- Use `laravel/sluggable` package for ingredient and cocktail slug generation | ||
- Added currently used Meilisearch host to user endpoint response | ||
- Update Meilisearch cocktail index settings | ||
- Add `user_id` to cocktail index | ||
- Implement ingredient varieties feature #6 | ||
- Increased API request rate limiting | ||
- Add cocktail ingredient substitutes feature | ||
- Add a new cocktail source list | ||
- Exclude optional cocktail ingredients from shelf cocktail matching | ||
- Implement all ingredient category resource endpoints | ||
- Update postman collection | ||
- Implement more tests | ||
|
||
# v0.2.0 | ||
- Add docker build action | ||
- Add glasses | ||
- Update base cocktail db | ||
- Update error handling | ||
- Add logout | ||
|
||
# v0.1.0 | ||
- Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Kami\Cocktail\Http\Controllers; | ||
|
||
use Kami\Cocktail\Models\IngredientCategory; | ||
use Kami\Cocktail\Http\Resources\SuccessActionResource; | ||
use Kami\Cocktail\Http\Requests\IngredientCategoryRequest; | ||
use Kami\Cocktail\Http\Resources\IngredientCategoryResource; | ||
|
||
class IngredientCategoryController extends Controller | ||
{ | ||
public function index() | ||
{ | ||
$categories = IngredientCategory::all(); | ||
|
||
return IngredientCategoryResource::collection($categories); | ||
} | ||
|
||
public function show(int $id) | ||
{ | ||
$category = IngredientCategory::findOrFail($id); | ||
|
||
return new IngredientCategoryResource($category); | ||
} | ||
|
||
public function store(IngredientCategoryRequest $request) | ||
{ | ||
$category = new IngredientCategory(); | ||
$category->name = $request->post('name'); | ||
$category->description = $request->post('description'); | ||
$category->save(); | ||
|
||
return (new IngredientCategoryResource($category)) | ||
->response() | ||
->setStatusCode(201); | ||
} | ||
|
||
public function update(IngredientCategoryRequest $request, int $id) | ||
{ | ||
$category = IngredientCategory::findOrFail($id); | ||
$category->name = $request->post('name'); | ||
$category->description = $request->post('description'); | ||
$category->save(); | ||
|
||
return (new IngredientCategoryResource($category)) | ||
->response() | ||
->setStatusCode(201); | ||
} | ||
|
||
public function delete(int $id) | ||
{ | ||
IngredientCategory::findOrFail($id)->delete(); | ||
|
||
return new SuccessActionResource((object) ['id' => $id]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Kami\Cocktail\Http\Requests; | ||
|
||
use Illuminate\Foundation\Http\FormRequest; | ||
|
||
class IngredientCategoryRequest extends FormRequest | ||
{ | ||
/** | ||
* Determine if the user is authorized to make this request. | ||
* | ||
* @return bool | ||
*/ | ||
public function authorize() | ||
{ | ||
return true; | ||
} | ||
|
||
/** | ||
* Get the validation rules that apply to the request. | ||
* | ||
* @return array<string, mixed> | ||
*/ | ||
public function rules() | ||
{ | ||
return [ | ||
'name' => 'required', | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
app/Http/Resources/CocktailIngredientSubstituteResource.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Kami\Cocktail\Http\Resources; | ||
|
||
use Illuminate\Http\Resources\Json\JsonResource; | ||
|
||
/** | ||
* @mixin \Kami\Cocktail\Models\CocktailIngredientSubstitute | ||
*/ | ||
class CocktailIngredientSubstituteResource extends JsonResource | ||
{ | ||
/** | ||
* Transform the resource into an array. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable | ||
*/ | ||
public function toArray($request) | ||
{ | ||
return [ | ||
'id' => $this->ingredient_id, | ||
'slug' => $this->ingredient->slug, | ||
'name' => $this->ingredient->name, | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.