We finally started a new application! This has in mind the community of developers that need help and can't share code property formatted. This has in mind learning how to create a laravel api and a vuejs SPA! What do you think ? Sounds interesting?
Thanks for the support, in January I'll be back with 3 videos a week, so I think we are getting there soon, even tho, we already have the gates in place, we just need to create a helper and a way to fetch the permissions.
This application will have a PayPal integration, but it's going to be a long way until then! But if there will be more requests on this, we could make a separate video!
Keeping a single project works well for small to medium projects, but the best practice when you are building a SPA(single page application) is to have the API on it's own project and the client app on another. Imagine this, you can use the same API for multiple implementations, like maybe you want a different admin application, a mobile app, the client web app etc. So, as a best practice for bigger projects is to have different repositories. Another advantage is that you can use any webpack version you want, laravel mix is actually not the best out there so, sometimes it gets in the way.
When you are building an API you usually have in mind something like your front-end that uses the API, maybe another one that is used by the clients and most common to have a mobile application too. Also, it's a better practice to have the front-end and back-end separated in case you want to have 2 versions or 2 front-ends that uses the same API, it's not that we couldn't use the laravel folder, it's just that I want to show the best and most common practice.Also If you want to take the front-end out is easier since it is another project. Even more, since they are 2 different projects, let's say you have 2 teams that work front-end and back-end, they won't have to check if someone else from the other team commited so that they can push etc. Other than the advantage of being easier to setup, there is none in keeping the projects on the same folder. Laravel boilerplate for front-end is to use it as a hybrid app, hence the logic to send the tokens and take it from meta tag etc.
hello peter. I tried to follow your video, but I have a little problem. on the console there is a GET http: // localhost: 8000 / api / net user :: ERR_CONNECTION_REFUSED and Uncaught (in promise) Type Error: Failed to fetch. What should be done for this problem ?
how to if any error in console "Access to fetch at 'localhost:8000/api/user' from origin 'localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled." ?
@@hilmihidayat this is a cors problem, you need to do what I do on videos too, but replace the URL that we put on config! cors.php if you have it different. I didn't install cors package on the first episode?
Oh, preset vue? Well first you need to the laravel/ui package installed. I hope this is the name. Check php artisan list and see if you have the commands there.