Category: Laravel 9
-
Post Views: 17 1. In Laravel 9, an error is reported: call to undefined method illuminate\\http\\resources\\missingValue::isempty(). as shown in Figure 1 2. Check the code implementation 3. Print $this->whenloaded(Customtagsenable), the result is as follows, which are the results of the resource after the model association is not loaded, and the resource after the model association is loaded 4. Re-implement the…
-
Post Views: 20 1. When there are multiple rows of data in the table, the implementation is as follows. Error: call to a member function value() on null. as shown in Figure 1 2. The adjustment is realized as follows. When the record does not exist, the query result is NULL. When the record exists, the query result is int(6),…
-
Post Views: 18 1. Job runs an error in Laravel 9: Has Been Attempted too many times or run too long. The job may have previously previously timed out.. as shown in Figure 1 2. The total number of records found in the table is 8761297. Based on the chunk method, the entire table is retrieved in units of 10…
-
Post Views: 23 1. Try to pass multiple fields/values based on the Redis facade Hset, the code is implemented as follows 2. Error during operation: local.error: err wrong number of arguments forhsetcommand. as shown in Figure 1 3. However, starting from Redis 4.0, HSET can set one or more field/value pairs at a time. Since Redis 4.0.0, HMSET is discarded,…
-
Post Views: 21 1. Reference:In Laravel 9, reuse Spatie\QueryBuilder\QueryBuilder in asynchronous queue to generate query SQL 2. The current implementation scheme, for a certain field, can only use one filter, or partial, or Exact. Reference:In Yii 2.0, implement the request parameter form of the filter. 3. For a single fuzzy search, multiple accurate search fields, decide to verify the type…
-
Post Views: 15 1. When using native expression query in Laravel 9, an error is reported: SQLState[42000]: Syntax error or access Violation: 1064 you have an error in your SQL syntax;. The reason should be with Hannah OConno is related. in it. as shown in Figure 1 2. Reference:In condition for multiple fields when using native expression query in Laravel…
-
Post Views: 16 1. The current request parameter structure is as follows. Prepare to verify config[‘appoint_country’][‘appoint_country’][‘value’][0], config[‘appoint_country’][‘appoint_country’][‘value’][1]. as shown in Figure 1 2. The verification code is implemented as follows. Try to verify that the maximum length of the value in the index array is 1. Validation failed, as expected. as shown in Figure 2 3. Specify a custom message…
-
Post Views: 16 1. The current collection format is as follows 2. If you need to look up based on id, the firstwhere method returns the first element in the collection with a given key/value pair 3. Now you need to look up based on the two key-value pairs of name and email. The first method returns the first element…
-
Post Views: 22 1. Reference: In MySQL 8, the IN condition is used for multiple fields. 2. When you need to use the native expression query in Laravel 9, the in condition is used for multiple fields. WhereRaw and OrwhereRaw methods inject the native “Where” into your query. 3. Execute error: sqlstate[42000]: Syntax error or access Violation: 1064 you have…