api: Cannot link to laravel's routes

I have a normal route like this:

Route::get('browse', [
    'as' => 'browse',
    'uses' => 'HomeController@browse',
]);

Normally I can generate url by using route('browse') or action('HomeController@browse') but now it doesn’t work with API’s routes.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 23 (9 by maintainers)

Commits related to this issue

Most upvoted comments

@amirhabibzadeh API_DOMAIN should ONLY be used when you’re using Laravel and have a virtual host configured for the sub-domain, for example, api.yourapp.com.

If you’re using API_DOMAIN then API_PREFIX should be null.

If you’re API is served from yourapp.com/api then you’ll want to be using API_PREFIX.

You should not be setting a prefix and a domain. One or the other.

@jasonlewis Great it’s working now i have already tried to remove the prefix but didn’t work then i return the prefix and remove the domain it’s working fine now

i think the problem was from the domain API_DOMAIN