Category: Web Application Development
-
Post Views: 13 1. Now there is a string with the following contents 2. It is expected to batch replace the default in the string to basic 3. Refer to the str::replaceArray function to replace the given value in the string using the array order 4. Since there is only one element in the array $replace, only one default is…
-
Post Views: 17 1. In Laravel 6, in the terminal, you can confirm that the queue has been executed. as shown in Figure 1 2. However, in Laravel Telescope, the status of the queuing job still shows that it is not finished. as shown in Figure 2 3. It is suspected that after updating Telescope, there is no reconfiguration and…
-
Post Views: 19 1. When the file module.json is deleted under modules/blog, a new migration file is generated: nwidart\modules\exceptions\moduleNotFoundException : module[Blog]does not exist!. as shown in Figure 1 2. Use the make:migration artisan command to create a migration, and use the –path option to customize the personal storage path that generates the migration file. as shown in Figure 2 3.…
-
Post Views: 62 1. Generate a new module: blog. 2. By default, the module class will not load automatically. You can load your modules automatically using PSR-4. Edit composer.json. as shown in Figure 1 3. Tip: Don’t forget to run composer dump-autoload. as shown in Figure 2 4. Generate a given console command for the specified module. 5. Edit CreatePostCommand.php,…
-
Post Views: 13 1. There are 2 fields in the table: original_theme_id, theme_id, the value of the field original_theme_id is derived from the theme_id of another record in the table. as shown in Figure 1 2. Set a one-to-one reverse association in the model. The code is implemented as follows 3. Get the code implementation of the associated attribute, the…
-
Post Views: 17 1. In MySQL 5.7, the data in the json type field is an array, and its value is:[365]. as shown in Figure 1 2. Reference: Query the constructor – where statement – json where statement:https://learnku.com/docs/laravel/6.x/queries/5171#35d9d9. JSON arrays can be queried using WhereJsonContains. as shown in Figure 2 3. The code is implemented as follows 4. Print the…
-
Post Views: 18 1. Doctrine\dbal\exception : unknown database type enum requested, doctrine\dbal\platforms\mysql57platform may not support it.. as shown in Figure 1 2. View the migration file, enum does not exist in the updated field type 3. The reason for the final determination may be that in the table involved in this migration file, the type of other fields is enum.…
-
Post Views: 16 1. The current implementation principle of the theme editor is: when a configuration item in the editor changes, the temporary storage API of the backend will be requested to cache the data to Redis. When the user clicks the save button, the save API of the backend is requested, and the data will be read from Redis…
-
Post Views: 21 1. The front-end request parameters are shown below. as shown in Figure 1 2. The backend converts the parameter $args of the method __invoke to json, which corresponds to the field in the front-end request body: variables. The code is implemented as follows 3. Print the JSON as follows. There are more fields: directive, and then the…