-
Notifications
You must be signed in to change notification settings - Fork 653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
problem to get laravel api route and that always get in laravel.blade.php as xhr(html) #31
Comments
Hi Marmulack. I digged to find that out too. All the requests are redirected to \vendor\tuandm\laravue-core\src\routes\laravue.php. You find all the routes in this file. ou can implement yours there as well |
Hi @marmulack, thanks for reaching this project We are preparing the docs to describe how to working with API in Laravue. |
thank's for your fast awnser @tuandm the
and route |
@marmulack Yes, thanks for pointing the problem. Next release of Laravue will remove routes in Laravel's package (tuandm/laravue-core...), and use default Laravel web.php/api.php instead. It will help users custom the routers by their way. |
Hi
Thank you for your Great work. That's very good.
So i have problem to get a laravel controller as a api. i try any ways for one weekend and so dissapointed. now i have one table name 'personal' is migrated true. that's have controller named 'app/Http/controllers/Api/PersonalController' and there class is 'app/Personal' and the resource are 'app/Http/Resources/PersonalCollection'. inside 'route/api.php' controller are routed true.
that's have on command 'php artisan route:list' true. so inside 'resources/js/api/tabel.js' i add the below code:
export function getPersonal() { return request({ url: '/personal', method: 'get', }); }
then create a vue component for test it like this:
so after run server and 'npm run watch' inside browser console have an error say
TypeError: response.data is undefined
and inside browser network personal are loaded as xhr couses and html type. that's header are passed OK but in Response are loaded laravue default page.this page are routed on 'route/web.php' as {any}
i try other way like SPA, direct request, loaded axios inside component and etc but all wayes return this problem.
The text was updated successfully, but these errors were encountered: