diff --git a/.env.example b/.env.example index 15a10a6..ed3c5f9 100755 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ APP_NAME=Laravel +APP_DESCRIPTION="AthenaHR - Your one-stop-shop for your community recruitment needs" APP_ENV=local APP_KEY= APP_DEBUG=true @@ -11,9 +12,16 @@ APP_LOGO="path/to/large/logo.png" APP_LOGO_SM="path/to/small/logo.png" APP_AUTH_BANNER="" APP_SITEHOMEPAGE="" + +# Add your status page here. It'll appear in error pages as a button. +# If you don't have one, leave it empty and the button won't show up. +APP_STATUSPAGE="https://status.athenahr.io" + + API_PREFIX="api" + # FEATURE OVERRIDES # Feature overrides allow you to force-enable/disable features regardless of application settings and feature flags # Turning on the override will disable its feature @@ -56,11 +64,18 @@ DB_DATABASE=laravel DB_USERNAME=root DB_PASSWORD= +## SERVICES + RECAPTCHA_SITE_KEY= RECAPTCHA_PRIVATE_KEY= RECAPTCHA_VERIFY_URL="https://www.google.com/recaptcha/api/siteverify" # WARNING: Your contact form will be useless if you change this value. Only change this URL if Google updates it. +# AthenaHR's defaut GTM ID is pre-configured unless you supply one - if you leave this on, we'll use analytics data to improve the app. +# Off by default +GTM_ENABLED=false +GTM_ID="GTM-T47K5CG" + MOJANG_STATUS_URL="https://status.mojang.com/check" MOJANG_API_URL="https://api.mojang.com" diff --git a/app/Ban.php b/app/Ban.php index c88278b..b9124ff 100755 --- a/app/Ban.php +++ b/app/Ban.php @@ -36,7 +36,7 @@ class Ban extends Model ]; public $casts = [ - 'bannedUntil', + 'bannedUntil' => 'datetime', ]; public function user() diff --git a/app/Events/ApplicationApprovedEvent.php b/app/Events/ApplicationApprovedEvent.php index c72d2db..c604174 100755 --- a/app/Events/ApplicationApprovedEvent.php +++ b/app/Events/ApplicationApprovedEvent.php @@ -30,7 +30,7 @@ class ApplicationApprovedEvent { use Dispatchable, InteractsWithSockets, SerializesModels; - public $application; + public Application $application; /** * Create a new event instance. diff --git a/app/Events/ApplicationDeniedEvent.php b/app/Events/ApplicationDeniedEvent.php index 48951a3..3a45a0f 100755 --- a/app/Events/ApplicationDeniedEvent.php +++ b/app/Events/ApplicationDeniedEvent.php @@ -30,7 +30,7 @@ class ApplicationDeniedEvent { use Dispatchable, InteractsWithSockets, SerializesModels; - public $application; + public Application $application; /** * Create a new event instance. diff --git a/app/Events/UserBannedEvent.php b/app/Events/UserBannedEvent.php index 05902ad..af024b0 100755 --- a/app/Events/UserBannedEvent.php +++ b/app/Events/UserBannedEvent.php @@ -31,9 +31,9 @@ class UserBannedEvent { use Dispatchable, InteractsWithSockets, SerializesModels; - public $user; + public User $user; - public $ban; + public Ban $ban; /** * Create a new event instance. diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 37c0edb..51c0c2e 100755 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -22,6 +22,7 @@ namespace App\Exceptions; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; +use Sentry\Laravel\Integration; use Throwable; class Handler extends ExceptionHandler @@ -45,34 +46,24 @@ class Handler extends ExceptionHandler 'password_confirmation', ]; - /** - * Report or log an exception. - * - * @param \Throwable $exception - * @return void - * - * @throws \Exception - */ - public function report(Throwable $exception) + public function register(): void { - if (app()->bound('sentry') && $this->shouldReport($exception)) { - app('sentry')->captureException($exception); - } - - parent::report($exception); + $this->reportable(function (Throwable $e) { + Integration::captureUnhandledException($e); + }); } /** * Render an exception into an HTTP response. * * @param \Illuminate\Http\Request $request - * @param \Throwable $exception + * @param \Throwable $e * @return \Symfony\Component\HttpFoundation\Response * * @throws \Throwable */ - public function render($request, Throwable $exception) + public function render($request, Throwable $e) { - return parent::render($request, $exception); + return parent::render($request, $e); } } diff --git a/composer.json b/composer.json index a372b89..27b61ab 100755 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "mpociot/teamwork": "^8.0", "opcodesio/log-viewer": "^1.2", "pragmarx/google2fa-laravel": "^1.3", - "sentry/sentry-laravel": "3.2.*", + "sentry/sentry-laravel": "3.6.*", "socialiteproviders/discord": "^4.1", "spatie/laravel-permission": "^5.5", "ultrono/markdown": "*" diff --git a/composer.lock b/composer.lock index 8b967a5..b86c7c3 100755 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b69f99d4cab0bf1ae806c2c8e9fd8205", + "content-hash": "366b9feca7fa3c75b96dd22ce137d9f4", "packages": [ { "name": "almasaeed2010/adminlte", @@ -5592,29 +5592,26 @@ }, { "name": "sentry/sentry-laravel", - "version": "3.2.0", + "version": "3.6.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-laravel.git", - "reference": "55ad9bd47766cec2d8978b8487c40e81a5a87d76" + "reference": "6aacef4d12c22046f68ab617ee1496b9655b8eb9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/55ad9bd47766cec2d8978b8487c40e81a5a87d76", - "reference": "55ad9bd47766cec2d8978b8487c40e81a5a87d76", + "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/6aacef4d12c22046f68ab617ee1496b9655b8eb9", + "reference": "6aacef4d12c22046f68ab617ee1496b9655b8eb9", "shasum": "" }, "require": { "illuminate/support": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0", "nyholm/psr7": "^1.0", "php": "^7.2 | ^8.0", - "sentry/sdk": "^3.3", - "sentry/sentry": "^3.12", + "sentry/sdk": "^3.4", + "sentry/sentry": "^3.20", "symfony/psr-http-message-bridge": "^1.0 | ^2.0" }, - "conflict": { - "laravel/lumen-framework": "*" - }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.11", "laravel/framework": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0", @@ -5647,7 +5644,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "Apache-2.0" + "MIT" ], "authors": [ { @@ -5669,7 +5666,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-laravel/issues", - "source": "https://github.com/getsentry/sentry-laravel/tree/3.2.0" + "source": "https://github.com/getsentry/sentry-laravel/tree/3.6.0" }, "funding": [ { @@ -5681,7 +5678,7 @@ "type": "custom" } ], - "time": "2023-02-01T10:56:52+00:00" + "time": "2023-06-29T10:31:13+00:00" }, { "name": "socialiteproviders/discord", @@ -9088,22 +9085,22 @@ }, { "name": "composer/class-map-generator", - "version": "1.0.0", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/composer/class-map-generator.git", - "reference": "1e1cb2b791facb2dfe32932a7718cf2571187513" + "reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/class-map-generator/zipball/1e1cb2b791facb2dfe32932a7718cf2571187513", - "reference": "1e1cb2b791facb2dfe32932a7718cf2571187513", + "url": "https://api.github.com/repos/composer/class-map-generator/zipball/953cc4ea32e0c31f2185549c7d216d7921f03da9", + "reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9", "shasum": "" }, "require": { - "composer/pcre": "^2 || ^3", + "composer/pcre": "^2.1 || ^3.1", "php": "^7.2 || ^8.0", - "symfony/finder": "^4.4 || ^5.3 || ^6" + "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7" }, "require-dev": { "phpstan/phpstan": "^1.6", @@ -9141,7 +9138,7 @@ ], "support": { "issues": "https://github.com/composer/class-map-generator/issues", - "source": "https://github.com/composer/class-map-generator/tree/1.0.0" + "source": "https://github.com/composer/class-map-generator/tree/1.1.0" }, "funding": [ { @@ -9157,7 +9154,7 @@ "type": "tidelift" } ], - "time": "2022-06-19T11:31:27+00:00" + "time": "2023-06-30T13:58:57+00:00" }, { "name": "composer/pcre", @@ -10136,16 +10133,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.22.0", + "version": "1.22.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "ec58baf7b3c7f1c81b3b00617c953249fb8cf30c" + "reference": "65c39594fbd8c67abfc68bb323f86447bab79cc0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/ec58baf7b3c7f1c81b3b00617c953249fb8cf30c", - "reference": "ec58baf7b3c7f1c81b3b00617c953249fb8cf30c", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/65c39594fbd8c67abfc68bb323f86447bab79cc0", + "reference": "65c39594fbd8c67abfc68bb323f86447bab79cc0", "shasum": "" }, "require": { @@ -10177,9 +10174,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.22.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.22.1" }, - "time": "2023-06-01T12:35:21+00:00" + "time": "2023-06-29T20:46:06+00:00" }, { "name": "phpunit/php-code-coverage", diff --git a/config/analytics.php b/config/analytics.php new file mode 100644 index 0000000..b21faa2 --- /dev/null +++ b/config/analytics.php @@ -0,0 +1,11 @@ + [ + 'gtm-enabled' => env('GTM_ENABLED', false), + 'gtm-id' => env('GTM_ID', 'GTM-T47K5CG') + ] + +]; diff --git a/config/app.php b/config/app.php index 12b310d..dade03c 100755 --- a/config/app.php +++ b/config/app.php @@ -34,6 +34,25 @@ return [ 'name' => env('APP_NAME', 'Laravel'), + + /* + |-------------------------------------------------------------------------- + | Application description + |-------------------------------------------------------------------------- + | + | This value is a short description of the application. The default value uses + | AthenaHR's tagline, but you can set your own value to match your branding. + | + | This value is used in the description meta-tags, so it shows up in search + | results and in embeds, such as Discord link previews. As such, this is a + | highly visible value, so make it count! + | + */ + + + 'description' => env('APP_DESCRIPTION', 'AthenaHR - Your one-stop-shop for your community recruitment needs'), + + /* |-------------------------------------------------------------------------- | Application Homepage @@ -69,7 +88,7 @@ return [ | It forces Laravel to load all assets via HTTPS, even when the environment is | set to "local". This setting is useless in production because it's already enforced. | If you don't enable this when using SSL locally, the pages won't load properly. - | If you're a regular user, don't touch this setting. + | If you're a regular user, you don't need to don't touch this setting. | */ 'force_secure' => env('NONPROD_FORCE_SECURE', false), @@ -79,7 +98,7 @@ return [ | IP address anonymity |-------------------------------------------------------------------------- | - | RB Recruiter collects IP addresses and stores them in the database in order to + | AthenaHR collects IP addresses and stores them in the database in order to | display them to site admins. | | This feature allows you to disable the display and collection of IP addresses, @@ -102,7 +121,7 @@ return [ | - Terms of Service, where you outline acceptable usage of your services; | - Community Guidelines, where you outline acceptable behavior for users on your platforms. | - | RBRecruiter will display these URLs at appropriate locations and force users to accept them, + | AthenaHR will display these URLs at appropriate locations and force users to accept them, | if legally necessary, such as in the registration & application form pages. | | Additionally, you can also specify a support email and URL where your users/customers can send inquiries if necessary. @@ -119,6 +138,20 @@ return [ 'support_email' => env('SUPPORT_EMAIL', 'support@example.com'), 'source_repo' => env('SOURCE_REPO', 'https://code.webvokestudio.pt/miguel456/rbrecruiter'), + + /* + |-------------------------------------------------------------------------- + | Status Page + |-------------------------------------------------------------------------- + | + | AthenaHR can display a helpful status page in error pages. If you want a button + | leading to your status page, fill in this value. Otherwise, leave it blank. + | + */ + + 'statuspage' => env('app_statuspage', ""), + + /* |-------------------------------------------------------------------------- | Application Environment diff --git a/resources/views/breadcrumbs/app.blade.php b/resources/views/breadcrumbs/app.blade.php index 87108cb..0ab09ac 100755 --- a/resources/views/breadcrumbs/app.blade.php +++ b/resources/views/breadcrumbs/app.blade.php @@ -1,10 +1,12 @@ @include('breadcrumbs.header')
- - - + @if(config('analytics.google.gtm-enabled')) + + + + @endif @if (session()->has('error')) diff --git a/resources/views/breadcrumbs/footer.blade.php b/resources/views/breadcrumbs/footer.blade.php index d1e47c0..0c0fe08 100755 --- a/resources/views/breadcrumbs/footer.blade.php +++ b/resources/views/breadcrumbs/footer.blade.php @@ -3,16 +3,18 @@ - + diff --git a/resources/views/breadcrumbs/header.blade.php b/resources/views/breadcrumbs/header.blade.php index 13d0765..b6c604f 100755 --- a/resources/views/breadcrumbs/header.blade.php +++ b/resources/views/breadcrumbs/header.blade.php @@ -4,18 +4,20 @@ - - - + @if(config('analytics.google.gtm-enabled')) + + + + @endif - + - + @@ -25,8 +27,8 @@{{ __('We process applications for our Discord server\'s management team here. If you have any questions, don\'t hesistate to contact our support team! Take a look at the open jobs below.') }}
+{{ __('Please feel free to take a look at any open roles below. If you see something you like, applying is easy!') }}
{!! __('If you\'d like to learn more about our community, make sure to visit our main website!', ['mainWebsiteUrlConfigValue' => config('app.sitehomepage')]) !!}