Category: Programming Language
-
Post Views: 19 1. In Laravel 6, after the model applies soft deletion, the record is inserted again, and the unique key conflicts. as shown in Figure 1 2. The reason is that after applying soft deletion, when you use the delete method on the model instance, the current date and time will be written to the deleted_at field. At…
-
Post Views: 14 1. There is a php Blade code block, which is placed in mysql, and its code is stored in the field schema, as shown in Figure 1 2. Some variables, already declared in the php script, the code block is shown below 3. The code of the compiled template file is as follows. 4. Decided to skip…
-
Post Views: 17 1. The original format of JSON data is as follows. The order of its key names is as follows: TexGetCux, QKGYGZ2st, YE9GC1KXT, Q1YQZ2RBI. as shown in Figure 1 2. Execute the code to insert the database as follows, print $extra[‘schema’] 3. Print $extra[‘schema’], which is equal to the original format of JSON data. as shown in Figure…
-
Post Views: 20 1. Execute the Composer Update in Homestead and report an error: Your requirements could not be resolved to an installable set of packages. The reason is that the PHP version is 8.0 , and the version of the package depends on 7. as shown in Figure 1 2. Reference:https://learnku.com/docs/laravel/5.8/homestead/3882#multiple-php-versions. Homestead 6 introduced support for multiple PHP versions…
-
Post Views: 18 1. Execute the generated sql, which can be found in the local Windows 10. In the liunx container, no records are found. Print records under Windows 10. as shown in Figure 1 2. Print the record under the liunx container. The result is null. as shown in Figure 2 3. Decide to print the generated sql, you…
-
Post Views: 13 1. Error in PHP 7.4: Illegal offset type in issue or empty. as shown in Figure 1 2. The code is as follows: 3. Print $setting, its value is the object. as shown in Figure 2 4. will $setting[‘settingId’]Convert to string. 5. The value of the printed and converted string is as follows 6. No more errors.
-
Post Views: 17 1. The value of the string: E:\wwwroot\object\storage\app/theme_dow nloads/2022/05/25/1653468314.0994.1295326141.zip 2. Values of other characters: E:\wwwroot\object\storage\app/ 3. The code is implemented as follows 4. Results: _downloads/2022/05/25/1653468314.0994.1295326141.zip. Expected is: Theme_Downloads/2022/05/25/1653468314.0994.1295326141.zip. as shown in Figure 1 5. The code implementation is adjusted as follows, remove the last / of the values of other characters 6. The results are in line with…
-
Post Views: 22 1. The database migration implementation is as follows, and an index is added to the UUID type field. 2. After the migration is performed, the table field type is char(36). as shown in Figure 1 3. In the constructor of the model file, set the field value of the UUID type to: str::OrderDuUID() to take advantage of…
-
Post Views: 16 1. Execute SQL as follows 2. Error: 1093 – you canT specific target tablexx_themesfor update in from clause. as shown in Figure 1 3. Reference:https://dev.mysql.com/doc/refman/5.7/en/update.html, in MySQL, you cannot modify the same table used in the Select section. You can connect the table to itself, which will cause MySQL to treat the table as two different things,…
-
Post Views: 17 1. The troupe stores the data of the play in a simple JSON file. 2. The bills they issued are also stored in a JSON file. 3. The following simple function is used to print the details of the bill. 4. Use the above data files (invoices.json and plays.json) as test input, run this code, you will…