Category: Laravel
-
Post Views: 18 1. Print the current object, its properties[architecture]=> 2.0 . as shown in Figure 1 2. The code is implemented as follows 3. Print object $wptheme, its attributes[architecture]=> 2.0. Print $wptheme->Architecture with a value of 1.0. Not as expected. as shown in Figure 2 4. Finally found the reason, the influence of the settings in the model file,…
-
Post Views: 18 1. Print the SQL statement executed by the program, and the result is as follows. as shown in Figure 1 2. The number of SQL statements executed by the print program is 79. Array elements start with 0. as shown in Figure 2 3. Print the SQL and copy it to MySQL 5.7 to execute. Its number…
-
Post Views: 23 1. To set the configuration value at runtime, pass an array to the config function, which is reset in the middleware 2. The Singleton method binds a class or interface to a container that is only parsed once. Once the singleton binding is resolved, the same object instance will be returned to the container in subsequent calls.…
-
Post Views: 18 1. The existing code is implemented as follows 2. The interface response structure is as follows, as shown in Figure 1 3. It is expected to put some fields in the field Theme_Installation into the first level, that is, level with the ID, and finally delete the Theme_Installation. 4. The final implementation code is as follows 5.…
-
Post Views: 24 1. The correlation of the model Theme is as follows 2. The correlation of the model ThemeInstallation is as follows 3. Error when obtaining the associated attribute: sqlstate[42S02]: base table or view not found: 1146 tableObject_wp.wp_theme_installationdoesn’tt exist . as shown in Figure 1 4. The table Theme_Installation does not exist in object_wp.wp_theme_installation, but actually exists in…
-
Post Views: 18 1. In the startup script of the docker container, if you want to force the migration command to run without prompt, use the –force parameter 2. At this stage, there is a module developed based on Laravel Modules, and there are migration files, such as: /modules/themestoredb/database/migrations . as shown in Figure 1 3. In the local development…
-
Post Views: 19 1. When performing database migration, an error is reported: sqlstate[42000]: Syntax Error or Access Violation: 1059 Identifier nametheme_installation_version_preset_theme_store_theme_version_id_indexis too long. as shown in Figure 1 The index length limit of MySQL 5.7 defaults to 64, while the length of the Theme_Installation_Version_Preset_Theme_Store_Theme_Version_ID_Index is 68. as shown in Figure 2 3. In Laravel 6, each indexing method accepts an…
-
Post Views: 18 1. In Laravel 6’s database migration, when adding a foreign key constraint, Illuminate\Database\QueryException : SQLState[HY000]: General error: 1215 Cannot add foreign key constraint. as shown in Figure 1 2. The code is implemented as follows 3. The code is adjusted as follows, and the error is still reported: 4. The field ASSET_ID type of the table Theme_Asset_Version…
-
Post Views: 19 1. Now the field Theme_Asset of the table Theme_Asset is of type VARCHAR(255). The previous migration code is as follows. as shown in Figure 1 2. Now plan to add a new migration file to modify the type of the field Theme_id is: UUID, that is, char(36). 3. Error: Doctrine\DBAL\Exception : Unknown column type “UUID” requested. As…