Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add redirectRoute and redirectAction helpers #145

Merged
merged 1 commit into from Aug 7, 2019
Merged

add redirectRoute and redirectAction helpers #145

merged 1 commit into from Aug 7, 2019

Conversation

faustbrian
Copy link
Contributor

1️⃣ Is this something that is wanted/needed? Did you create a feature-request issue first?
Yes https://github.com/calebporzio/livewire/issues/140

2️⃣ Does it contain multiple, unrelated changes? Please separate the PRs out.
No

3️⃣ Does it include tests if possible? (Not a deal-breaker, just a nice-to-have)
Yes

4️⃣ Please include a thorough description of the feature/fix and reasons why it's useful.
Adds the redirectRoute and redirectAction methods to provide a more convenient way of redirecting from inside components.

Route

// Before
$this->redirect(route('home'));

// After
$this->redirectRoute('home');

Action

// Before
$this->redirect(action('HomeController@index'));

// After
$this->redirectAction('HomeController@index');

Under the hood it supports the same arguments as the route and action functions.

5️⃣ Thanks for contributing! 🙌

@calebporzio
Copy link
Collaborator

Good PR, thanks!

@calebporzio calebporzio merged commit 4e538ae into livewire:master Aug 7, 2019
@faustbrian faustbrian deleted the feat/redirect-helpers branch August 7, 2019 16:00
@lancepioch
Copy link
Contributor

@all-contributors please add @faustbrian for code

@allcontributors
Copy link
Contributor

@lancepioch

I've put up a pull request to add @faustbrian! 🎉

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.

None yet

3 participants