Tag: Laravel 6
-
Post Views: 23 1. In Laravel 6, the request with query parameters is lost after the 302 jump. as shown in Figure 1 2. The original plan to determine whether the query parameter exists at a specific request. If it exists, it will be automatically brought with it after the 302 jump. However, this scheme cannot be avoided that there…
-
Post Views: 17 1. In Laravel 6, define the route as follows 2. Now you need to adjust /static/xxx to get the value from the environment variable, that is, use the global config function to access the configuration value 3. Print output/ / *. config(filesystems.disks.theme-asset-cdn.root) .{theme_id}/{asset_key}, its value is: /static/xxx/{theme_id}/{asset_key} . and the corresponding controller method can be executed. in…
-
Post Views: 21 1. URL:https://object.local/?oseid=2052A62hlvOV6hlqej5yS2MwoYpUxXTtMQQb, when a certain condition is met, you want to delete the query parameter: oseid and make the URL change to:https://object.local/. Don’t want to use 302 jump implementation. 2. The specific implementation is as follows 3. The printing results are as follows, in line with expectations. as shown in Figure 1
-
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. 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: 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: 20 1. Define in the GraphQL schema file as follows 2. In the custom validator class Validator classes modules\\OnlineStoreEthemeGraphQL\\Validators\\UnpublishThemeValidator, the code is implemented as follows 3. The request verification failed, which is in line with expectations. as shown in Figure 1 4. Confirm the sql generated by the verification rule again, and generate the following. as shown in…
-
Post Views: 16 1. There was an implementation before, which is to judge a specific record, whether it meets a certain complex nesting condition, and the code is implemented as follows 2. Now you need to query all records that meet this complex nesting condition, refer to:https://learnku.com/docs/laravel/6.x/queries/5171#2f5914, the code is implemented as follows 3. The final generated SQL is in…
-
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,…