如何使用url()获取域路由laravel 5.2

consider the following example:

Route::group(['domain' => 'something.example.local'], function() {
    Route::get('scripts', 'SomethingController@scripts');
});

Now lets assume you are are on something.example.local/scripts and you hover over a link as such: <a href="{{ url(/scripts) }}">hello world</a> you will see something.example.local/scripts. great.

No go to example.local and do the same thing: example.local/scripts .... Thats wrong. It should say: something.example.local/scripts.

How do you use laravel helper methods to get the appropriate and complete url, domain and all?

I think you should name your route.

Here:

Route::group(['domain' => 'something.example.local'], function() {
    Route::get('scripts', ['as' => 'route.name', 'uses' => 'SomethingController@scripts']);
});

And in your a tag:

<a href="{{ route('route.name') }}">hello world</a>

Done!