将变量从路径传递到刀片视图

I have app in Laravel and Vue.js. In navbar.blade.php I did something like this:

<p>{!! $test !!}</p>

Now I want to change that variable to text using only routing. Can I do it? How?

If not, how I can keep that variable but change it in vue.js?

you can try like

Route::get('path/{test}', function ($test) {
    return view('viewblade', ['test' => $test]);
});

Hope these will Help.

As per your comment,

I have navbar and I include it in my components. Now I want to have different text on all pages.

I think you can make use of Blade yield. I'm assuming you are using Blade extends

Change your <p> tag in your nav components from

<p>{!! $test !!}</p>

To

<p>@yield('testValue')</p>

and in every page, add this after @extends(....)

@section('testValue', 'MyValueSpecificToThisPage')

Hope it's helpful.