You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use App\Http\Requests\CreateApiCommitPastelRequest;
use App\Http\Resources\CommitResource;
use App\Models\Commit;
use App\Models\User;
use App\Queries\CommitPageQuery;
use Illuminate\Container\Attributes\CurrentUser;
use Illuminate\Http\JsonResponse;
final readonly class CommitPastelController
{
/**
* Gives the commit one pastel from the user's daily allowance, as the web's pastel button does. It answers with the
* commit as its page shows it, so the app gets the new pasteis_count, with how many pastéis the user has left
* today and how many its author has been given in all. With none left, it is a pasteis_exhausted error.
*/
public function store(CreateApiCommitPastelRequest $request, #[CurrentUser] User $user, Commit $commit, CreateCommitPastel $action, CommitPageQuery $page): CommitResource|JsonResponse