inertiajs / inertia-laravel

The Laravel adapter for Inertia.js.
https://inertiajs.com
MIT License
2.08k stars 234 forks source link

add inertia_location helper #491

Closed RoduanKD closed 1 year ago

RoduanKD commented 1 year ago

I was working on a SaaS project and I needed to redirect to a tenant domain/subdomain. I googled around and saw this issue. and I saw @reinink comment and didn't notice the word "Ruby" 😅, and that's when I discovered that this helper isn't available in the Laravel adapter.

I thought about writing a test but ended up knowing that it won't pass since the other-domain isn't configured anywhere. HelperTests.php

    public function test_the_location_helper_function_returns_a_response_instance(): void
    {
        $this->assertInstanceOf(Response::class, inertia_location('http://other-domain.test/');
    }
reinink commented 1 year ago

Yup, sure, seems like a reasonable addition 👍