Category: Web Framework
-
Post Views: 16 1. In Laravel, when responding to 404 in the middleware, an error is reported: View[components.css]not found. as shown in Figure 1 2. Check the corresponding topic, confirm that the file /resources/views/view_object/components/css.blade.php exists. as shown in Figure 2 3. The same response of 404 code, error in the middleware: View[components.css]not found. Response 404 in the controller method. Print…
-
Post Views: 25 1. Reference: In Laravel 6, based on ZipStream PHP, stream the zip file to the S3 bucket. Reference: Generate a stream resource based on Fopen in PHP 7.4, operate the disk, and adjust it to a memory-based implementation. The compression and decompression is successful based on 360, and the decompression based on WinRAR fails. as shown in…
-
Post Views: 20 1. In Laravel 8, the exponential fallback in the queue task is natively realized. Reference:https://learnku.com/laravel/t/50086 2. Reference:http://snags88.github.io/backoff-strategy-for-laravel-jobs. backoff strategy for laravel jobs. 3. In modern applications, when there is a problem, you will try to retry the block of code that caused the problem. For example, if you are using Gmail and you lose your internet connection,…
-
Post Views: 17 1. In Laravel 6, in the queue task, when the maximum number of tasks that the task can try is greater than 1, it fails on the second run: Must be an instance of app\models\theme, null given. The reason is that the queue task does not support trying again. as shown in Figure 1 2. When the…
-
Post Views: 17 1. When requesting the S3 bucket, you have encountered a current limit problem: Please reduce your request rate, which leads to the failure of the request. as shown in Figure 1 2. The final implementation code is as follows 3. Open the CDN address corresponding to S3 in the browser:https://xxx.cloudfastin.com/static/xxx/98cb73f9-e61a-40b1-a27a-3beb99015e5e/assets.zip. The file can be downloaded, and confirm…
-
Post Views: 17 1. In Laravel 6, ThemeInstallation::IscodeEdited must return a relationship instance.. as shown in Figure 1 2. View the method in the model file 3. Finally found the reason, $theme->ThemeInstallation->iscodeEdited needs to add ()
-
Post Views: 20 1. When I encounter a bug in the production environment, after a new container is newly deployed, when the first run, the value of the environment variables feels that it is not the environment variable of the container, but null. On the second run, the value of its environment variables is correct. On the first run, the…
-
Post Views: 12 1. Query the list (converted to an array) in Laravel 6, why you have to convert it to an array, the reason is that the current requirements are additional fields that need to be assigned a single record during the traversal process. This extra field does not exist in the model. 2. Cause the occurrence of N…
-
Post Views: 17 1. Table TABLE_A is in the A database, and the table TABLE_B is in the B database. The two tables are linked together via columns table_a.id , table_b.table_a_id . 2. Refer to the advanced JOIN statement:https://learnku.com/docs/laravel/6.x/queries/5171#211e4f. Reference:https://stackoverflow.com/questions/41423603/join-two-mysql-tables-in-different-databases-on-the-same-server-with-laravel-elo. as shown in Figure 1 3. The final code is as follows 4. The final generated SQL is as follows,…