Category: PHP 7.4
-
Post Views: 17 1. When using Redis with Laravel, there are two solutions, one is to install the phpredis php extension, and the other is to install the predis/predis package through composer. However, Predis has been abandoned by the original author of the package and may be removed from Laravel in future releases. It was finally decided to use the…
-
Post Views: 18 1. The existing array structure is as follows, and its key name is the form of lowercase letters and underscores. 2. It is expected to adjust the name of the array key to the hump form. The traditional way is to generate a new key in the form of a hump based on the foreach traversal. This…
-
Post Views: 19 1. When writing the automated test case of Lighthouse 5, split a test method into two test methods. The present stage is a method 2, split into two methods 3. Run the test and report an error: Error: Error: call to undefined method illuminate\support\facades\config::set(). as shown in Figure 1 4. At this time, if any of the…
-
Post Views: 16 1. Reference URL:https://lighthouse-php.com/4/testing/phpunit.html#setup, test with phpunit . In Lighthouse, it is easy to add automated tests with phpunit. 2. Run the GraphQL Query API and respond 200. The main test field: The responses of TheMeAssets. as shown in Figure 1 3. Edit /modules/themestore/tests/functional/graphql/onlineStoreEthemeGraphQLapTest.php, the code is as follows 4. Execute the command: ./vendor/bin/phpunit .\modules\themestore\tests\functional\graphql\OnlineStoreEthemeGraphQLapTest.php . Error: Failed…
-
Post Views: 15 1. The name of the table field is in the form of lowercase letters and underscores. as shown in Figure 1 2. The interface is implemented based on GraphQL, and the field name that is specified as the interface response must be in the form of hump. 3. Print the parser /modules/themestore/resolver/onlinestoreetheme/themeassesResolver.php method $themeAssets, the object property…
-
Post Views: 59 1. When executing the command composer update –ignore-platform-reqs, an error is reported: script @php artisan package:discover –ansi handling the Post-autoload-dump event returned with error code 255. as shown in Figure 1 2. Why the option –ignore-platform-reqs is added when executing the composer update command. The reason is that when executing composer update, an error is reported: it…
-
Post Views: 21 1. Reference URL:https://www.shuijingwanwq.com/2021/12/29/5622/, Laravel 8.x is deployed to Heroku, based on PostgreSQL implementation. Therefore, some steps can be omitted. 2. In the local development environment, the Laravel native environment has been deployed. Open URL:http://larabbs.local/, the response 200. as shown in Figure 1 3. Verify your installation, to verify your CLI installation, use the heroku –version command. Current…
-
Post Views: 19 1. When installing Laravel/Horizon based on Composer, an error is reported: Package Laravel/Horizon at version ~5.6 has requirements incompatible with Your php version, php extensions and composer version. as shown in Figure 1 2. Based on the prompt information, install the PHP extension: PCNTL, POSIX, but PCNTL is not available under Windows. as shown in Figure 2…