Category: Web Framework
-
Post Views: 19 1. In Laravel 9, a list of APIs has now been implemented, which is based on Spatie\QueryBuilder\QueryBuilder to easily build Eloquent queries from API requests. However, now you need to implement a function of exporting Excel on the list page, planned to be implemented in asynchronous queues. So, if you want to reuse the code that built…
-
Post Views: 63 1. Error: class “vtifulkernelexcel” not found. 2. The reason is that the extension php-ext-xlswriter is not installed. 3. GitHub Release: https://github.com/viest/php-ext-xlswriter/releases download php-windows-xlswriter-cf7e1933-8.1-ts-vs16-x64.zip. as shown in Figure 1 4. After decompression, copy php_xlswriter.dll to C:php-8.1.27extphp_xlswriter.dll 5. Edit php.ini, add extension=xlswriter 6. After restarting php, the error is reported again:[ERROR]workbook_close(): error creatingE:WWWRootObjectStorageAppExport/Order/Order Export Task 2024-02-19 10:24:06.xls. error =…
-
Post Views: 15 1. In Laravel 9, after executing redis::set($this->rules_update_key, carbon::now()); and found that the written value is Object. as shown in Figure 1 2. But in the test environment, the written value is a datetime string. Its value: 2024-01-30 06:00:00. as shown in Figure 2 3. The final comparison found that the root of the difference is that in…
-
Post Views: 16 1. Set the default value of DateTime in MySQL 8.0 to be0000-00-00 00:00:00Time error: sqlstate[42000]: Syntax error or access Violation: 1067 Invalid default value forOPERATED_AT_GMT. as shown in Figure 1 2. Reference:https://www.shuijingwanwq.com/2022/09/28/6993/In Navicat for MySQL, when the table is copied from one database to another, an error is reported:[ERR]1292 – Incorrect DateTime Value: ‘0000-00-00 00:00:00’ for column…
-
Post Views: 19 1. In Laravel 9, when executing: php artisan telescope:install error: error there are no commands defined in the “teleScope” namespace.. as shown in Figure 1 2. Discover the config/app.php configuration file of the TeleScopeServiceProvider service provider in the application configuration file that has been deleted. Add it back first. as shown in Figure 2 3. Run again:…
-
Post Views: 17 1. When implementing a request based on guzzle, php http client, when the response is not 20x, the $response variable cannot be obtained. as shown in Figure 1 2. At this stage, it is necessary to judge the value of the field status in the response, so as to do subsequent logical processing. Reference:https://docs.guzzlephp.org/en/stable/request-options.html#http-errors. Set to FALSE…
-
Post Views: 21 1. Reference:In Laravel 6, during the execution of the queue, the execution of each task will execute view::addLocation($location); however, each task will only take the $location of the first task. . However, it is found that there are still problems in the subsequent production environment. During queue execution, some view files are not executed (“Setting_Migrations”:[]). as shown…
-
Post Views: 15 1. Now you need to take the URI format data from a one-dimensional array. The print result of a one-dimensional array, as shown in Figure 1 2. The implementation is as follows based on the filter_var code, and the printing result is as follows, which does not meet the expectations, which exists: internal://policy_pages/29 3. Obtain the scheme…
-
Post Views: 19 1. When writing a log in Laravel 6, the log file at that time was not created. When writing the log, the time of the operating system is Beijing time: 2023-09-15 11 , but laravel-2023-09-15.log is not generated. as shown in Figure 1 2. Found only Laravel-2023-09-14.log, print output: config(app.timezone). The reason for the discovery is that…