-
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/import' into feature/add_frontend_dashboard
# Conflicts: # app/Http/Controllers/Api/V1/TimeEntryController.php # app/Providers/JetstreamServiceProvider.php
- Loading branch information
Showing
96 changed files
with
3,442 additions
and
107 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 |
---|---|---|
|
@@ -37,7 +37,7 @@ MAIL_PORT=1025 | |
MAIL_USERNAME=null | ||
MAIL_PASSWORD=null | ||
MAIL_ENCRYPTION=null | ||
MAIL_FROM_ADDRESS="[email protected]" | ||
MAIL_FROM_ADDRESS="[email protected]" | ||
MAIL_FROM_NAME="${APP_NAME}" | ||
|
||
AWS_ACCESS_KEY_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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,4 @@ yarn-error.log | |
/blob-report/ | ||
/playwright/.cache/ | ||
/coverage | ||
/extensions/* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Exceptions\Api; | ||
|
||
use Exception; | ||
use Illuminate\Http\JsonResponse; | ||
use Illuminate\Http\Request; | ||
use LogicException; | ||
|
||
abstract class ApiException extends Exception | ||
{ | ||
public const string KEY = 'api_exception'; | ||
|
||
/** | ||
* Render the exception into an HTTP response. | ||
*/ | ||
public function render(Request $request): JsonResponse | ||
{ | ||
return response() | ||
->json([ | ||
'error' => true, | ||
'key' => $this->getKey(), | ||
'message' => $this->getTranslatedMessage(), | ||
], 400); | ||
} | ||
|
||
/** | ||
* Get the key for the exception. | ||
*/ | ||
public function getKey(): string | ||
{ | ||
$key = static::KEY; | ||
|
||
if ($key === ApiException::KEY) { | ||
throw new LogicException('API exceptions need the KEY constant defined.'); | ||
} | ||
|
||
return $key; | ||
} | ||
|
||
/** | ||
* Get the translated message for the exception. | ||
*/ | ||
public function getTranslatedMessage(): string | ||
{ | ||
return __('exceptions.api.'.$this->getKey()); | ||
} | ||
} |
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,10 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Exceptions\Api; | ||
|
||
class TimeEntryStillRunningApiException extends ApiException | ||
{ | ||
public const string KEY = 'time_entry_still_running'; | ||
} |
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,10 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Exceptions\Api; | ||
|
||
class UserNotPlaceholderApiException extends ApiException | ||
{ | ||
public const string KEY = 'user_not_placeholder'; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
Oops, something went wrong.