Category: Web Application Development
-
Post Views: 20 1. Use the following Artisan command to generate a new queue task for the specified module. as shown in Figure 1 2. Task distribution, push tasks to the queue 3. Edit /modules/themestoredb/jobs/themeinstallation.php . The processing example in the queue is mainly to change the value of the field step of the table Theme_Installation_Task to 2. 4. Start…
-
Post Views: 22 1. Now for an API, 4 tables need to be inserted. The 1st table is the table in database A, and the other 3 tables are the table in database B, and the primary key of the 1st table will be inserted into the 2nd table. 2 database connections have been configured. are WordPress and DB respectively.…
-
Post Views: 20 1. Use database transactions in Laravel 6’s Eloquent ORM. The application only uses PHP 7.0 and later, so replace \Exception with \Throwable. Reference:https://stackoverflow.com/questions/49814785/how-can-i-use-transaction-with-eloquent-laravel-5-5 2. The final implementation code is as follows 3. When the transaction fails specially, the third model is inserted into a non-existent field, the transaction is rolled back, and the data is not inserted…
-
Post Views: 19 1. In Laravle 6’s database migration, the data table option does not support adding comments. as shown in Figure 1 2. Reference:https://stackoverflow.com/questions/37493431/how-to-add-comment-to-table-not-column-in-laravel-5-migration. How to add comment to table (not column) in Laravel 5 migration? 3. The final realization is as follows 4. After performing the database migration, check the execution results, and the table comments have been…
-
Post Views: 22 1. Check the existing code, which is implemented based on the function app. The app function returns the service container instance. Unable to jump to the corresponding method by clicking getByName() . as shown in Figure 1 2. Refer to the automatic injection of the service container. You can simply inject the dependencies that require container resolution,…
-
Post Views: 15 1. Lighthouse uses a lot of SDL and uses mode instructions. In order to improve your editing experience, you can use the artisan command to generate a definition file. Error: Illuminate\Contracts\Container\BindingResolutionException : target[Modules\ThemeStore\View\ViewStorageInterface]Is not instantiable while building[Modules\ThemeStore\Resolver\OnlineStoreThemeResolver]. as shown in Figure 1 2. Execute the command: php artisan module:list to display a list of all modules. Confirm…
-
Post Views: 16 1. Error: Argument 1 Passed to App\\Exceptions\\Handler::report() must be an instance of exception, instance of typeError given, called in E:\WWRoot\\Object\Vendor\\nuwave\Lighthouse\src\execution\\reportingErrorHandler.php on line 40. as shown in Figure 1 2. Reference URL:https://www.shuijingwanwq.com/en/2022/01/26/9945/. Caused by version compatibility issues. Edit /vendor/nuwave/lighthouse/src/execution/reportingErrorHandler.php. Print $error. Message: Argument 1 Passed to Nuwave\Lighthouse\Schema\TypeRegistry::get() must be of the type string, array given, Called in E:\WwWroot\Object\Vendor\NuWave\Lighthouse\src\Schema\Typeregistry.php…
-
Post Views: 17 1. When the language area is en , when the validated parameter does not exist, the response: The selected theme ID is invalid. as shown in Figure 1 2. When the language area is zh_cn, when the validated parameter does not exist, the response: the selected Theme ID is invalid. Expected: The selected theme ID is invalid.…