```php
foreach($users as $user) {
$user->dontHaveOrder() && dd($user->id);
....
}
```
Also, this has been attempted before: https://github.com/laravel/framework/pull/52862
Propose helper function, `dd_when`, allowing conditional debugging with `dd()`. This function provides a simple way to invoke dd() based on a boolean condition.
Example Usage:
```php
dd_when($...
Propose helper function, `dd_when`, allowing conditional debugging with `dd()`. This function provides a simple way to invoke dd() based on a boolean condition.
Example Usage:
```php
dd_when($...
Propose helper function, `dd_when`, allowing conditional debugging with `dd()`. This function provides a simple way to invoke dd() based on a boolean condition.
Example Usage:
```php
dd_when($...
As a workaround, the Eloquent Builder returned is the one being built by the `Relation` instance, not the parent's query builder (as `Illuminate\Database\Eloquent\Relations\Relation` uses the `Illu...
**You can use a custom placeholder**
<p>{!! str_replace('__PIPE__', '|', trans_choice('home.greeting', 0, ['name' => 'Alex __PIPE__ Moi'])) !!}</p>
Above code return your desired result which...
Make sure the data types of promotional_price and price columns are compatible. If one is a string and the other is a number, the comparison may fail.
In addition, for PHP 8.4, mariaDB or PSQL, ...
Funny, I came across a similar thing earlier when I was trying to write a docblock for the output. Larastan also apparently does some magic with this. https://github.com/larastan/larastan/pull/1860...
I figured I could fix the above issue by passing the `create` attributes to the `state` method as we're already doing today, followed by simply setting them again after the `make` call is finished ...
The aforementioned problem has been solved, by setting the state as was already being done, the only difference is that now we make sure to update it with the `create` attributes afterwards.
Ver...
Yes, it just doesn't make sense to include attributes like `ScopedBy`, `CollectedBy` and `ObeservedBy`, but omit this one. Out of all these four, `QueriedBy` would be the one I would use the most. ...
Currently this unfortunately leads to other problems, specifically those related to situations such as this:
```php
Something::factory()->create([
'related_id' => $related->id,
]);
```
...
### Laravel Version
11.23.5
### PHP Version
8.2.14
### Database Driver & Version
_No response_
### Description
Currently, a collection `groupBy()` returns the same type of collection, contai...
Thanks for submitting a PR!
Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.
Pull requests that a...
Today, the `create` attributes are ignored/overwritten by those "defaulted" in `afterMaking`, while in theory `afterMaking` should run prior to `create`, followed by `afterCreated` being ran.
T...
> Thanks for this! This is a great replacement for some similar manual hacking that I did within my application to achieve such a thing.
>
>
>
> Just curious: is there any intention of adding th...
Thanks for this! This is a great replacement for some similar manual hacking that I did within my application to achieve such a thing.
Just curious: is there any intention of adding this to [the...
Thanks for your pull request to Laravel!
Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful reg...
…er.php
<!--
Please only send a pull request to branches that are currently supported: https://laravel.com/docs/releases#support-policy
If you are unsure which branch your pull request shou...