Skip to content

[5.6] Add thenPingIf and pingBeforeIf#24077

Merged
taylorotwell merged 2 commits into
laravel:5.6from
ThunderBirdsX3:5.6
May 2, 2018
Merged

[5.6] Add thenPingIf and pingBeforeIf#24077
taylorotwell merged 2 commits into
laravel:5.6from
ThunderBirdsX3:5.6

Conversation

@ThunderBirdsX3

@ThunderBirdsX3 ThunderBirdsX3 commented May 2, 2018

Copy link
Copy Markdown
Contributor

In case of you want to ping in specific condition.

$schedule->command('something')
         ->everyMinute()
         ->pingBeforeIf(app()->environment() == 'production', $url)
         ->thenPingIf(app()->environment() == 'production', $url);

@taylorotwell taylorotwell merged commit 07e1c5e into laravel:5.6 May 2, 2018
@GrahamCampbell GrahamCampbell changed the title Add thenPingIf and pingBeforeIf [5.6] Add thenPingIf and pingBeforeIf May 3, 2018
@sailingdeveloper

Copy link
Copy Markdown
Contributor

To be consistent with when on the Builder and Collection, shouldn't it be pingBeforeWhen and thenPingWhen?

@timodejong95

Copy link
Copy Markdown

@ThunderBirdsX3 ?

@ThunderBirdsX3

Copy link
Copy Markdown
Contributor Author

I don't know. I just use thenPingIf and pingBeforeIf for no reason.

I think you must to ask @taylorotwell . Why it shouldn't it be pingBeforeWhen and thenPingWhen?

@timodejong95

Copy link
Copy Markdown

@ThunderBirdsX3 thenPingWhen and pingBeforeWhen should be more consistent with the current Laravel code like @sailingdeveloper mentioned previously.

Also here is an example: https://laravel.com/docs/5.6/blade#including-sub-views here includeIf is more a if exists do it and includeWhen is conditional based.

@taylorotwell Do you agree?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants