Update star route.
This commit is contained in:
1 parent
f2e6cba2f5
commit
2b595c1403
4 files changed
+23
-8
No files matched your search
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Krzysiej\RyobiCrawler\Controller;
|
||||
|
||||
use Krzysiej\RyobiCrawler\Models\Product;
|
||||
|
||||
final class StarController extends BaseController
|
||||
{
|
||||
public function __invoke(int $productId): void
|
||||
{
|
||||
Product::find($productId)->toggleStarred()->save();
|
||||
header('Location: ' . $_SERVER['HTTP_REFERER']);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user