Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
955 views
in Technique[技术] by (71.8m points)

Laravel Livewire Anchor Tag Url Not Working

I am using Laravel 8 with Livewire. My Laravel Livewire application URL is like http://localhost/myproject.

My Laravel Livewire admin panel url is like http://localhost/myproject/admin.

I am fetching problem with anchor tag. When I change the page in pagination the View button URL in Livewire add public is automatically.

My View button code as below:

<a href="{{route('manage-product',$resdata->id)}}" class="btn btn-primary">View</a>

but, link is showing like http://localhost/myproject/public/admin/manage-product/15. That View button link in public is automatically added by Livewire.

How i can remove public from url('/') function?

I attached a screen shot, please check. screen shot


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Dont forget to add entry point to your project in server settings. and in .env file you should write "APP_URL=http://localhost".


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...