diff --git a/.env.example b/.env.example index db9f7b61..a0e4c81a 100644 --- a/.env.example +++ b/.env.example @@ -4,12 +4,13 @@ APP_KEY= APP_DEBUG=true APP_URL=http://localhost -APP_TIMEZONE=UTC APP_LOCALE=en APP_FALLBACK_LOCALE=en APP_FAKER_LOCALE=en_US APP_MAINTENANCE_DRIVER=file APP_MAINTENANCE_STORE=database +PHP_CLI_SERVER_WORKERS=4 + BCRYPT_ROUNDS=12 LOG_CHANNEL=stack @@ -40,7 +41,7 @@ MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null -MAIL_ENCRYPTION=null +MAIL_SCHEME=null AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= diff --git a/.gitignore b/.gitignore index e3e177e0..fa5d0b46 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /public/hot /public/storage /storage/*.key +/storage/pail /vendor .env .env.* @@ -129,3 +130,4 @@ storage/backups cron-fail.log .DS_Store .phpunit.cache/ +/.nova diff --git a/app/Console/Commands/QuickBooks/GenerateVendingNetJournalEntryCommand.php b/app/Console/Commands/QuickBooks/GenerateVendingNetJournalEntryCommand.php index 993119fd..45cd2925 100644 --- a/app/Console/Commands/QuickBooks/GenerateVendingNetJournalEntryCommand.php +++ b/app/Console/Commands/QuickBooks/GenerateVendingNetJournalEntryCommand.php @@ -26,7 +26,7 @@ class GenerateVendingNetJournalEntryCommand extends Command /** * Execute the console command. */ - public function handle() + public function handle(): void { if (! QuickBooksAuthSettings::hasKnownAuth()) { return; diff --git a/app/Console/Commands/QuickBooks/RefreshAccessToken.php b/app/Console/Commands/QuickBooks/RefreshAccessToken.php index 61404b34..3e1fb771 100644 --- a/app/Console/Commands/QuickBooks/RefreshAccessToken.php +++ b/app/Console/Commands/QuickBooks/RefreshAccessToken.php @@ -26,7 +26,7 @@ class RefreshAccessToken extends Command /** * Execute the console command. */ - public function handle() + public function handle(): void { if (! QuickBooksAuthSettings::hasKnownAuth()) { return; diff --git a/app/Console/Commands/Stripe/TopUpIssuingBalance.php b/app/Console/Commands/Stripe/TopUpIssuingBalance.php index 3235f73d..5e744918 100644 --- a/app/Console/Commands/Stripe/TopUpIssuingBalance.php +++ b/app/Console/Commands/Stripe/TopUpIssuingBalance.php @@ -25,7 +25,7 @@ class TopUpIssuingBalance extends Command /** * Execute the console command. */ - public function handle() + public function handle(): void { // This code should only be temporary until we have the full system built out to manage current issuing balance diff --git a/app/External/Slack/Modals/CountdownTestModal.php b/app/External/Slack/Modals/CountdownTestModal.php index a3c33226..d907492a 100644 --- a/app/External/Slack/Modals/CountdownTestModal.php +++ b/app/External/Slack/Modals/CountdownTestModal.php @@ -26,7 +26,7 @@ public function __construct(?int $timeLeft) blocks: [ Kit::section( text: 'This is a test to see how responsive something like a countdown is.' - ) + ), ], ); @@ -41,7 +41,7 @@ public function __construct(?int $timeLeft) actionId: self::START_COUNTDOWN, text: 'Start Countdown', style: ButtonStyle::PRIMARY, - ) + ), ], blockId: self::START_COUNTDOWN ), diff --git a/app/External/Slack/Modals/CreateTrainableEquipment.php b/app/External/Slack/Modals/CreateTrainableEquipment.php index 0b703f7a..8d569ddc 100644 --- a/app/External/Slack/Modals/CreateTrainableEquipment.php +++ b/app/External/Slack/Modals/CreateTrainableEquipment.php @@ -14,8 +14,8 @@ class CreateTrainableEquipment implements ModalInterface { - use ModalTrait; use HasExternalOptions; + use ModalTrait; private const EQUIPMENT_NAME = 'equipment-name'; @@ -71,8 +71,8 @@ public function __construct(?Customer $user) Kit::context( elements: [ Kit::plainText( - text: 'Users/trainers will be automatically added to these channels/emails. All are ' . - 'optional. Email must be an existing group, for now. Please ask in #general and we\'ll ' . + text: 'Users/trainers will be automatically added to these channels/emails. All are '. + 'optional. Email must be an existing group, for now. Please ask in #general and we\'ll '. 'help make one if needed.' ), ], @@ -123,7 +123,7 @@ public static function callbackId(): string public static function handle(SlackRequest $request): JsonResponse { if (! $request->customer()->hasMembership(UserMembership::MEMBERSHIP_META_TRAINER)) { - Log::warning('CreateTrainableEquipment: Rejecting unauthorized submission from user ' . $request->customer()->id); + Log::warning('CreateTrainableEquipment: Rejecting unauthorized submission from user '.$request->customer()->id); throw new \Exception('Unauthorized'); } diff --git a/app/External/Slack/Modals/EquipmentAuthorization.php b/app/External/Slack/Modals/EquipmentAuthorization.php index 92c57b8b..17ba1518 100644 --- a/app/External/Slack/Modals/EquipmentAuthorization.php +++ b/app/External/Slack/Modals/EquipmentAuthorization.php @@ -16,9 +16,9 @@ class EquipmentAuthorization implements ModalInterface { + use HasExternalOptions; use ModalTrait; use RespondsToBlockActions; - use HasExternalOptions; private const EQUIPMENT_DROPDOWN = 'equipment-dropdown'; @@ -121,7 +121,7 @@ public static function handle(SlackRequest $request): JsonResponse ]); } - return (new SuccessModal("Authorization submitted!"))->update(); + return (new SuccessModal('Authorization submitted!'))->update(); } /** @@ -140,7 +140,7 @@ public static function getBlockActions(): array public static function equipmentFromState($state): Collection { $equipmentIds = array_map( - fn($formValue) => str_replace('equipment-', '', $formValue), + fn ($formValue) => str_replace('equipment-', '', $formValue), $state[self::EQUIPMENT_DROPDOWN][self::EQUIPMENT_DROPDOWN] ?? [] ); @@ -150,7 +150,7 @@ public static function equipmentFromState($state): Collection public static function peopleFromState($state): Collection { $customerIds = array_map( - fn($formValue) => str_replace('customer-', '', $formValue), + fn ($formValue) => str_replace('customer-', '', $formValue), $state[self::PERSON_DROPDOWN][self::PERSON_DROPDOWN] ?? [] ); @@ -188,16 +188,16 @@ public static function onBlockAction(SlackRequest $request) // Get names of equipment for which the member is already a user $trainedEquipmentNames = $selectedEquipment - ->where(fn($e) => $person->hasMembership($e->user_plan_id)) - ->map(fn($e) => $e->name); + ->where(fn ($e) => $person->hasMembership($e->user_plan_id)) + ->map(fn ($e) => $e->name); if ($trainedEquipmentNames->isNotEmpty()) { $alreadyTrained[$traineeName] = $trainedEquipmentNames; } // Get names of equipment for which the member is already a trainer $trainerForEquipmentNames = $selectedEquipment - ->where(fn($e) => $person->hasMembership($e->trainer_plan_id)) - ->map(fn($e) => $e->name); + ->where(fn ($e) => $person->hasMembership($e->trainer_plan_id)) + ->map(fn ($e) => $e->name); if ($trainerForEquipmentNames->isNotEmpty()) { $alreadyTrainers[$traineeName] = $trainerForEquipmentNames; } @@ -217,7 +217,7 @@ public static function onBlockAction(SlackRequest $request) $modal->modalView->blocks( Kit::context( elements: [ - Kit::mrkdwnText($trainee . ' is already trained on ' . $equipmentNames->join(', ')), + Kit::mrkdwnText($trainee.' is already trained on '.$equipmentNames->join(', ')), ], ), ); @@ -227,7 +227,7 @@ public static function onBlockAction(SlackRequest $request) $modal->modalView->blocks( Kit::context( elements: [ - Kit::mrkdwnText($trainer . ' is already a trainer for ' . $equipmentNames->join(', ')), + Kit::mrkdwnText($trainer.' is already a trainer for '.$equipmentNames->join(', ')), ], ), ); diff --git a/app/External/Slack/Modals/HasExternalOptions.php b/app/External/Slack/Modals/HasExternalOptions.php index f07d9bab..729e6bac 100644 --- a/app/External/Slack/Modals/HasExternalOptions.php +++ b/app/External/Slack/Modals/HasExternalOptions.php @@ -7,5 +7,5 @@ trait HasExternalOptions { - public abstract static function getExternalOptions(SlackRequest $request): OptionsResult; + abstract public static function getExternalOptions(SlackRequest $request): OptionsResult; } diff --git a/app/External/Slack/Modals/ManageOpenHouseModal.php b/app/External/Slack/Modals/ManageOpenHouseModal.php index 7c64eb54..d70e1d77 100644 --- a/app/External/Slack/Modals/ManageOpenHouseModal.php +++ b/app/External/Slack/Modals/ManageOpenHouseModal.php @@ -30,7 +30,7 @@ public function __construct() foreach (Door::all() as $door) { $doorCheckboxOptions->append(Kit::option( text: $door->humanReadableName, - value: 'device-' . $door->dsxDeviceId, + value: 'device-'.$door->dsxDeviceId, initial: $door->openDuringOpenHouseByDefault )); } @@ -74,12 +74,12 @@ public static function callbackId(): string public static function handle(SlackRequest $request): JsonResponse { if (! $request->customer()->canIDcheck()) { - Log::warning('ManageOpenHouseModal: Rejecting unauthorized submission from user ' . $request->customer()->id); + Log::warning('ManageOpenHouseModal: Rejecting unauthorized submission from user '.$request->customer()->id); throw new \Exception('Unauthorized'); } $values = $request->payload()['view']['state']['values']; - Log::info('Manage open house modal: ' . print_r($values, true)); + Log::info('Manage open house modal: '.print_r($values, true)); $selectedTime = $values[self::EXPIRES_TIME][self::EXPIRES_TIME]['selected_time']; $selectedOptions = collect($values[self::DOORS][self::DOORS]['selected_options']) @@ -89,13 +89,13 @@ public static function handle(SlackRequest $request): JsonResponse $selectedTimeCarbon = now()->tz('America/Denver'); $selectedTime = explode(':', $selectedTime); - $selectedTimeCarbon->hour = (int)$selectedTime[0]; - $selectedTimeCarbon->minute = (int)$selectedTime[1]; + $selectedTimeCarbon->hour = (int) $selectedTime[0]; + $selectedTimeCarbon->minute = (int) $selectedTime[1]; $doors = Door::all(); /** @var Door $door */ foreach ($doors as $door) { - $shouldOpen = $selectedOptions->contains('device-' . $door->dsxDeviceId); + $shouldOpen = $selectedOptions->contains('device-'.$door->dsxDeviceId); if ($selectedOptions->contains(self::CLOSE_ALL_DOORS)) { $door->shouldOpen(false); } else { diff --git a/app/External/Slack/Modals/ManageVolunteerGroups.php b/app/External/Slack/Modals/ManageVolunteerGroups.php index fbda1854..9801c308 100644 --- a/app/External/Slack/Modals/ManageVolunteerGroups.php +++ b/app/External/Slack/Modals/ManageVolunteerGroups.php @@ -25,8 +25,8 @@ public function __construct() submit: 'Submit', blocks: [ Kit::section( - text: "This feature is not yet implemented.", - ) + text: 'This feature is not yet implemented.', + ), ] ); } diff --git a/app/External/Slack/Modals/MembershipOptionsModal.php b/app/External/Slack/Modals/MembershipOptionsModal.php index 4927f917..6a4a0049 100644 --- a/app/External/Slack/Modals/MembershipOptionsModal.php +++ b/app/External/Slack/Modals/MembershipOptionsModal.php @@ -54,7 +54,7 @@ public function __construct(?Customer $customer) placeholder: 'Select an item', options: $membershipOptions, ), - ) + ), ] ); @@ -81,7 +81,7 @@ public static function handle(SlackRequest $request): JsonResponse break; case self::QUICK_OPEN_HOUSE_VALUE: if (! $request->customer()->canIDcheck()) { - Log::warning('QuickOpenHouse: Rejecting unauthorized submission from user ' . $request->customer()->id); + Log::warning('QuickOpenHouse: Rejecting unauthorized submission from user '.$request->customer()->id); throw new \Exception('Unauthorized'); } Door::quickOpenHouse(); @@ -89,7 +89,7 @@ public static function handle(SlackRequest $request): JsonResponse return self::clearViewStack(); case self::ALL_DOORS_DEFAULT_VALUE: if (! $request->customer()->canIDcheck()) { - Log::warning('QuickOpenHouse: Rejecting unauthorized submission from user ' . $request->customer()->id); + Log::warning('QuickOpenHouse: Rejecting unauthorized submission from user '.$request->customer()->id); throw new \Exception('Unauthorized'); } Door::quickDefaultDoors(); diff --git a/app/External/Slack/Modals/NeedIdCheckModal.php b/app/External/Slack/Modals/NeedIdCheckModal.php index 6a5a9b01..b7694f78 100644 --- a/app/External/Slack/Modals/NeedIdCheckModal.php +++ b/app/External/Slack/Modals/NeedIdCheckModal.php @@ -53,7 +53,7 @@ public function __construct() placeholder: 'Select a Customer', options: $customers ), - ) + ), ], ); } @@ -66,7 +66,7 @@ public static function callbackId(): string public static function handle(SlackRequest $request): JsonResponse { if (! $request->customer()->canIDcheck()) { - Log::warning('NeedIdCheckModal: Rejecting unauthorized submission from user ' . $request->customer()->id); + Log::warning('NeedIdCheckModal: Rejecting unauthorized submission from user '.$request->customer()->id); throw new \Exception('Unauthorized'); } diff --git a/app/External/Slack/Modals/NewMemberIdCheckModal.php b/app/External/Slack/Modals/NewMemberIdCheckModal.php index 1089c677..926e421e 100644 --- a/app/External/Slack/Modals/NewMemberIdCheckModal.php +++ b/app/External/Slack/Modals/NewMemberIdCheckModal.php @@ -34,7 +34,7 @@ public function __construct($customer_id) ); } else { $membershipWaiverSection = Kit::section( - text: Kit::mrkdwnText(':x: No waiver found.'), # TODO see next page after ID check + text: Kit::mrkdwnText(':x: No waiver found.'), // TODO see next page after ID check ); } @@ -85,7 +85,7 @@ public function __construct($customer_id) ), Kit::section( text: Kit::plainText( - 'The numbers on the card will look like either "12345 3300687-1" or "175-012345" and ' . + 'The numbers on the card will look like either "12345 3300687-1" or "175-012345" and '. 'you should enter "12345" in this field.', ), ), diff --git a/app/External/Slack/Modals/NewMemberInfoModal.php b/app/External/Slack/Modals/NewMemberInfoModal.php index c006322b..8419488a 100644 --- a/app/External/Slack/Modals/NewMemberInfoModal.php +++ b/app/External/Slack/Modals/NewMemberInfoModal.php @@ -11,15 +11,15 @@ class NewMemberInfoModal implements ModalInterface use ModalTrait; private const INFO = [ - "This is a community. You are a member, not a customer. This organization runs on the contributions of its members.", + 'This is a community. You are a member, not a customer. This organization runs on the contributions of its members.', "We're a drug and alcohol free space. There is hazardous equipment here, always keep everyone's safety in mind.", "Don't live or sleep at the space. That includes in the parking lot. Don't leave your car in the lot overnight.", "There are other tenants in the building. Don't go upstairs except for the gender neutral bathroom since there's not one on the first floor. Close denhac doors if no one else is in the room. The exterior doors are unlocked randomly throughout the day.", - "Slack has many channels you can join. Channels prefixed with help- are a good place to start to ask for training on equipment. Channels prefixed with sig- are a good place to start volunteering and get involved. Reply in threads to make channels easier to follow.", + 'Slack has many channels you can join. Channels prefixed with help- are a good place to start to ask for training on equipment. Channels prefixed with sig- are a good place to start volunteering and get involved. Reply in threads to make channels easier to follow.', "Read all signs everywhere and abide by them. Also read the wiki. If something isn't in the wiki, add it. Check out the How To page on our website, it provides some information on 'How to be a denhac member' essentially.", "No Harassment or Bullying: This includes, but is not limited to, attention that comes after a request to stop. Recognize and respect everyone's differences. Treat all members with kindness and respect. Our anti-harassment policy is part of the member agreement you've agreed to - please read it.", - "The last Saturday of the month is Hack denhac Day. The space is closed for personal project work. Come help us work on the space.", - "Leave the space better than you found it. Take out the trash. Communicate any issues through Slack.", + 'The last Saturday of the month is Hack denhac Day. The space is closed for personal project work. Come help us work on the space.', + 'Leave the space better than you found it. Take out the trash. Communicate any issues through Slack.', ]; public function __construct() diff --git a/app/External/Slack/Modals/OpenDoorModal.php b/app/External/Slack/Modals/OpenDoorModal.php index 2daae9d8..33c5ec03 100644 --- a/app/External/Slack/Modals/OpenDoorModal.php +++ b/app/External/Slack/Modals/OpenDoorModal.php @@ -25,7 +25,7 @@ public function __construct() foreach (Door::all() as $door) { $doorButtonOptions->append(Kit::option( text: $door->humanReadableName, - value: 'device-' . $door->dsxDeviceId, + value: 'device-'.$door->dsxDeviceId, )); } @@ -57,13 +57,13 @@ public static function handle(SlackRequest $request): JsonResponse { $customer = $request->customer(); $values = $request->payload()['view']['state']['values']; - Log::info('Open Door Modal: ' . print_r($values, true)); + Log::info('Open Door Modal: '.print_r($values, true)); $selectedOption = collect($values[self::DOORS][self::DOORS]['selected_option']); /** @var Door $door */ $door = Door::all() - ->filter(fn($door) => $selectedOption['value'] == 'device-' . $door->dsxDeviceId) + ->filter(fn ($door) => $selectedOption['value'] == 'device-'.$door->dsxDeviceId) ->first(); if (is_null($door)) { @@ -76,10 +76,10 @@ public static function handle(SlackRequest $request): JsonResponse $earliestAllowedTimestamp = Carbon::now()->subMinutes(5)->getTimestamp(); $atTheSpace = $accessLogs - ->where('user_id', $customer->slack_id) - ->where('ip', setting('ip.space')) - ->filter(fn($data) => $data['date_last'] >= $earliestAllowedTimestamp) - ->count() > 0; + ->where('user_id', $customer->slack_id) + ->where('ip', setting('ip.space')) + ->filter(fn ($data) => $data['date_last'] >= $earliestAllowedTimestamp) + ->count() > 0; if ($atTheSpace) { event(new DoorControlUpdated($door->momentaryOpenTime, $door->shouldOpen(true))); diff --git a/app/External/Slack/Modals/SelectAMemberModal.php b/app/External/Slack/Modals/SelectAMemberModal.php index 518f305d..7888154c 100644 --- a/app/External/Slack/Modals/SelectAMemberModal.php +++ b/app/External/Slack/Modals/SelectAMemberModal.php @@ -12,8 +12,8 @@ class SelectAMemberModal implements ModalInterface { - use ModalTrait; use HasExternalOptions; + use ModalTrait; private const SELECT_A_MEMBER = 'select-a-member'; @@ -82,7 +82,7 @@ public static function getExternalOptions(SlackRequest $request): OptionsResult /** @var Customer $customer */ $name = "{$customer->first_name} {$customer->last_name}"; - if(! is_null($filterValue) && ! Str::contains(Str::lower($name), Str::lower($filterValue))) { + if (! is_null($filterValue) && ! Str::contains(Str::lower($name), Str::lower($filterValue))) { continue; } diff --git a/app/Http/Controllers/AllCardsController.php b/app/Http/Controllers/AllCardsController.php index 9031b6d0..452a4091 100644 --- a/app/Http/Controllers/AllCardsController.php +++ b/app/Http/Controllers/AllCardsController.php @@ -9,9 +9,11 @@ class AllCardsController extends Controller { - private const DENHAC_ACCESS = "denhac"; - private const SERVER_ROOM_ACCESS = "Server Room"; - private const CAN_OPEN_HOUSE_UDF = "dh_can_open_house"; + private const DENHAC_ACCESS = 'denhac'; + + private const SERVER_ROOM_ACCESS = 'Server Room'; + + private const CAN_OPEN_HOUSE_UDF = 'dh_can_open_house'; public function __invoke(Request $request) { @@ -19,33 +21,32 @@ public function __invoke(Request $request) ->paginate(100) ->through(function ($customer) { /** @var Customer $customer */ - $cards = $customer->cards - ->filter(fn($card) => $card->member_has_card) + ->filter(fn ($card) => $card->member_has_card) ->map(function ($card) use ($customer) { - /** @var Card $card */ + /** @var Card $card */ - // Their card should only be active if it's already set to active, they have it, and they're a - // member. We already filter out cards that the member for sure does not have. - $activeCard = $card->active && $customer->member; + // Their card should only be active if it's already set to active, they have it, and they're a + // member. We already filter out cards that the member for sure does not have. + $activeCard = $card->active && $customer->member; - $access = []; - if($activeCard) { - $access[] = self::DENHAC_ACCESS; + $access = []; + if ($activeCard) { + $access[] = self::DENHAC_ACCESS; - if ($customer->hasMembership(UserMembership::SERVER_ROOM_ACCESS)) { - $access[] = self::SERVER_ROOM_ACCESS; + if ($customer->hasMembership(UserMembership::SERVER_ROOM_ACCESS)) { + $access[] = self::SERVER_ROOM_ACCESS; + } } - } - return [ - 'card_num' => $card->number, - 'access' => $access, - ]; - })->all(); + return [ + 'card_num' => $card->number, + 'access' => $access, + ]; + })->all(); $extra = []; - if($customer->isABoardMember() || $customer->isAManager()) { + if ($customer->isABoardMember() || $customer->isAManager()) { $extra[] = self::CAN_OPEN_HOUSE_UDF; } diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index bd3e17ed..2e8af07a 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -2,11 +2,4 @@ namespace App\Http\Controllers; -use Illuminate\Foundation\Auth\Access\AuthorizesRequests; -use Illuminate\Foundation\Validation\ValidatesRequests; -use Illuminate\Routing\Controller as BaseController; - -abstract class Controller extends BaseController -{ - use AuthorizesRequests, ValidatesRequests; -} +abstract class Controller {} diff --git a/app/Http/Controllers/SlackOptionsController.php b/app/Http/Controllers/SlackOptionsController.php index c0ed7d81..00bf43b5 100644 --- a/app/Http/Controllers/SlackOptionsController.php +++ b/app/Http/Controllers/SlackOptionsController.php @@ -6,7 +6,6 @@ use App\External\Slack\Modals\HasExternalOptions; use App\Http\Requests\SlackRequest; use ReflectionClass; -use SlackPhp\BlockKit\Surfaces\OptionsResult; class SlackOptionsController extends Controller { @@ -33,7 +32,7 @@ private function blockSuggestion(SlackRequest $request) } $reflect = new ReflectionClass($modalClassName); if (! array_key_exists(HasExternalOptions::class, $reflect->getTraits())) { - throw new \Exception("Requested external options from Slack modal that does not implement the external options trait."); + throw new \Exception('Requested external options from Slack modal that does not implement the external options trait.'); } return $modalClassName::getExternalOptions($request); diff --git a/artisan b/artisan index 8e04b422..c35e31d6 100644 --- a/artisan +++ b/artisan @@ -1,6 +1,7 @@ #!/usr/bin/env php handleCommand(new ArgvInput); +/** @var Application $app */ +$app = require_once __DIR__.'/bootstrap/app.php'; + +$status = $app->handleCommand(new ArgvInput); exit($status); diff --git a/composer.json b/composer.json index 9ca304b1..cf7fcc58 100644 --- a/composer.json +++ b/composer.json @@ -15,11 +15,11 @@ "anlutro/l4-settings": "^1.4", "guzzlehttp/guzzle": "^7.9", "hashids/hashids": "^5.0", - "laravel/framework": "^11.44", + "laravel/framework": "^12.9", "laravel/horizon": "^5.31", "laravel/passport": "^12.4", "laravel/reverb": "^1.4", - "laravel/tinker": "^2.9", + "laravel/tinker": "^2.10.1", "php-http/curl-client": "^2.3", "predis/predis": "^2.3", "quickbooks/v3-php-sdk": "^6.2", @@ -32,16 +32,17 @@ "spatie/laravel-webhook-client": "^3.4", "spatie/ssl-certificate": "^2.6", "stripe/stripe-php": "^16.6", - "symfony/http-client": "^7.0", - "symfony/mailgun-mailer": "^7.0", - "ylsideas/feature-flags": "^2.6" + "symfony/http-client": "^7.2", + "symfony/mailgun-mailer": "^7.2", + "ylsideas/feature-flags": "^3.0" }, "require-dev": { "deployer/deployer": "^7.5", "fakerphp/faker": "^1.23", "mockery/mockery": "^1.6", - "nunomaduro/collision": "^8.0", - "phpunit/phpunit": "^11.0.1" + "nunomaduro/collision": "^8.6", + "phpunit/phpunit": "^11.5.3", + "laravel/pail": "^1.2.2" }, "config": { "optimize-autoloader": true, @@ -83,6 +84,10 @@ ], "post-update-cmd": [ "@php artisan vendor:publish --tag=laravel-assets --ansi --force" + ], + "dev": [ + "Composer\\Config::disableProcessTimeout", + "npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite" ] } } diff --git a/public/.htaccess b/public/.htaccess index b75525be..b574a597 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -9,12 +9,16 @@ RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + # Handle X-XSRF-Token Header + RewriteCond %{HTTP:x-xsrf-token} . + RewriteRule .* - [E=HTTP_X_XSRF_TOKEN:%{HTTP:X-XSRF-Token}] + # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301] - # Handle Front Controller... + # Send Requests To Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] diff --git a/public/index.php b/public/index.php index 947d9896..ee8f07e9 100644 --- a/public/index.php +++ b/public/index.php @@ -1,5 +1,6 @@ handleRequest(Request::capture()); +/** @var Application $app */ +$app = require_once __DIR__.'/../bootstrap/app.php'; + +$app->handleRequest(Request::capture()); diff --git a/routes/console.php b/routes/console.php index 75ade13f..46580b33 100644 --- a/routes/console.php +++ b/routes/console.php @@ -25,7 +25,7 @@ // daily at noon because the cron is in UTC but I grab Denver timezone minus one day. This makes the date string // for searching orders as well as the date used for the QuickBooks entry correct regardless of if it's daylight -//savings time or not. +// savings time or not. Schedule::command('quickbooks:generate-vending-net-journal-entry')->dailyAt('12:00'); Schedule::command('stripe:top-up-issuing-balance')->daily(); diff --git a/storage/app/.gitignore b/storage/app/.gitignore index 8f4803c0..fedb287f 100755 --- a/storage/app/.gitignore +++ b/storage/app/.gitignore @@ -1,3 +1,4 @@ * +!private/ !public/ !.gitignore diff --git a/storage/app/private/.gitignore b/storage/app/private/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/storage/app/private/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/tests/Unit/PreventDuplicateIssueNumbersTest.php b/tests/Unit/PreventDuplicateIssueNumbersTest.php index ef6875c8..73bfc18a 100644 --- a/tests/Unit/PreventDuplicateIssueNumbersTest.php +++ b/tests/Unit/PreventDuplicateIssueNumbersTest.php @@ -9,7 +9,7 @@ class PreventDuplicateIssueNumbersTest extends TestCase { /** @test */ - public function preventDuplicateIssueNumbers(): void + public function prevent_duplicate_issue_numbers(): void { $issues = collect(get_declared_classes()) ->filter(fn ($name) => str_starts_with($name, 'App\\Issues\\Types')) diff --git a/tests/Unit/TempBanTest.php b/tests/Unit/TempBanTest.php index dc26f39a..87f6ae0b 100644 --- a/tests/Unit/TempBanTest.php +++ b/tests/Unit/TempBanTest.php @@ -9,7 +9,7 @@ class TempBanTest extends TestCase { /** @test */ - public function isBanned_returns_true_if_row_exists_with_both_user_and_channel(): void + public function is_banned_returns_true_if_row_exists_with_both_user_and_channel(): void { TempBan::create([ 'user_id' => 'foo_user', @@ -20,7 +20,7 @@ public function isBanned_returns_true_if_row_exists_with_both_user_and_channel() } /** @test */ - public function isBanned_returns_false_if_row_only_has_user(): void + public function is_banned_returns_false_if_row_only_has_user(): void { TempBan::create([ 'user_id' => 'foo_user', @@ -31,7 +31,7 @@ public function isBanned_returns_false_if_row_only_has_user(): void } /** @test */ - public function isBanned_returns_false_if_row_only_has_channel(): void + public function is_banned_returns_false_if_row_only_has_channel(): void { TempBan::create([ 'user_id' => 'foo_user', @@ -42,7 +42,7 @@ public function isBanned_returns_false_if_row_only_has_channel(): void } /** @test */ - public function isBanned_before_expiration_time_returns_true(): void + public function is_banned_before_expiration_time_returns_true(): void { TempBan::create([ @@ -55,7 +55,7 @@ public function isBanned_before_expiration_time_returns_true(): void } /** @test */ - public function isBanned_after_expiration_time_returns_false(): void + public function is_banned_after_expiration_time_returns_false(): void { TempBan::create([