'What is the default optimization level, if I use the cargo build --release command?

The rustc compiler has 4 optimization level, just like gcc.

opt-level    
This flag lets you control the optimization level.

0: no optimizations
1: basic optimizations
2: some optimizations
3: all optimizations
s: optimize for binary size
z: optimize for binary size, but also turn off loop vectorization.

If I make a build with Cargo and its --release option, which optimization level is used?

cargo build --release
Finished release [optimized] target(s) in 0.75s


Solution 1:[1]

The name of the function in the model cannot be the same as the name of a field in your table. Also in my case the column names do not follow the laravel/eloquent nomenclature so another parameter is added to belongsTo with the field name

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Waris Abdullah