It's been mentioned but only in replies that if you are on a Windows machine you will need to modify your etc/hosts file to have both the domains accessible
dont know if anyone gives a shit but if you guys are stoned like me during the covid times then you can stream pretty much all of the new movies and series on Instaflixxer. Been binge watching with my gf for the last couple of days =)
But the storm kept on spreading, it even spread to countries such as Syria, Egypt, Libya, Sudan and many more. It spread so much destruction that I can't even explain in words. Millions were dying instantly. It was so horrible I wish it would never happen like this. I said to myself what exactly did Israel do to cause such a huge storm. What was in that building that Arab countries were angry about. And when will this horrible storm stop? 🌟please find more about these important dreams of Muhammad Qasim. We are the last generation of this ummah
Thanks a lot Quentin. A very nice tutorial. Please include my request as well along with Leon's request. Vue SPA (with vuetify or Quasar) and Laravlel Passport. Kind regards.
hey Sir , you are delivering a great content and extremly well understood , are you expecting please to make a long detailled video for the most used tool like wordpress dev. ? ( php , css ..) to let us learn how to master the themes/plugins customization and creation please ? thank you x 1000 for your content.
Calling env() in your code is a bad practice since env() function is slow. Consider api domain to your config file and call env() there since config gets cached and then use that config variable in your code. Also, thank you for awesome series, love watching them!
whatever works for you to speed up production or optimise security, sure. :) This was just 1 slightly better practice than hard coding the URL into the project. I never intended this to go to production. It's a simple learning project.
Someone can make this "think" work on windows (preferably with laragon?, i try it with wamp too) Route::domain('api.peoplefinder.test') im stuck with this like almost one day and i cant make it work By the way, nice theoretical lesson (the practice part... i cant do it yet jaja) P/D: I know quentin is using a mac... but i cant affort that.... maybe if i sell my neightboor kidneys i could buy... naaa... too risky... jaja
:p There are many windows computers that cost the same as a mac. I am using Laravel valet which automatically registers and points my test domains, but normally on windows you have to set up this domain in the `/etc` file. This code creates a subdomain which you will also have to set up in the `/etc` file Route::domain('api.peoplefinder.test')
@@QuentinWatt I try to undestand my problem, could it be this 4 things 1) windows 2) my version of laravel (7.28.3) dealing with "domain" line 3) Laragon. (i believe is like valet, not linkin obviously) 4) the routing file (its below) you say i need to set up this
I've got through this now but there's a couple of changes in the latest versions of the tools that he's using. The syntax for the routes in laravel appears to be different now. Route::domain('api.peoplefinder.test') and Route::domain(env('API_DOMAIN')) worked for me. Postman as a Chrome extension is being retired, but is still available. And sequel pro doesn't support the default authentication with mysql, so you have to change the mysql authentication to legacy, instructions are on stack overflow - stackoverflow.com/questions/51179516/sequel-pro-and-mysql-connection-failed?rq=1
There are many different syntaxes for routes. Mine are not wrong. You have options. I am not using Postman as a chrome extension, I am using the postman app. Which is not being retired. Please don't leave comments like this unless you are absolutely sure because these can misinform other people watching my videos. Thank you.
if you have an error , this video doesn't teach everything, so I suggest Windows Users or Mac, First watch this video: ruclips.net/video/r40yAZAi6PQ/видео.html , another note is that you must write your function in the Laravel Controller , otherwise it would give error as it did for me .
That is incorrect. You're welcome to download the code for free (link in the description) to find your errors. :) If you can paste the exact error into the comment section, I can help point you in the right direction.
when i try to make the route::domain('api.peoplefinder.test') on windows ( timestamp 7:07 ), my browser and postman cant reach this site. Is there a different way from windows os?
I am using Laravel Valet which automatically maps my domains. Since you are on a windows computer, you may need to add the sub domain to your hosts file in order to access it. I have a video on the topic here: ruclips.net/video/fuiW9tWkzXU/видео.html Simply add api.peoplefinder.test along with any other URLs you have mapped.
Hi. Thanks for the work. This is a very useful tutorial. I am practicing this tutorial on my local ubuntu server. I was trying to fetch to API using the subdomain version you taught in the tutorial but its showing "this site can't be reached" issue whenever I try to get method. I think it has to something with creating a subdomain in my virtual server or maybe something else. Can you help me resolve the issues?
It sounds like you don't have a local server set up. I'm not too sure how to do that on ubuntu but I use Laravel Valet on my mac for that. See my tutorials on how to set up Laravel. :)
Nice clear explanation. I think it would be better to use a config file for the API domain that can be cached rather than access the env function directly? It could also concat API prefix and APP_URL ?
whatever works for you to speed up production or optimise security, sure. :) This was just 1 slightly better practice than hard coding the URL into the project.
Domain issue: I had an error by entering Route::domain(value:'api.peoplefinder.test'). Then I removed value and tried with Route::domain('api.peoplefinder.test'). No errors.
@@theknowledgeworldbyspecial9823 probably you need to have the laravel project in api.peoplefinder.test too by creating the symbolic link for that check google or other tutorial videos
Hi there Quentin! Great videos!! Just a question: Is there a benefit of using subdomain for api instead of /api/? From an SSL perspective, it is more expensive to protect a wildcard instead of a single URL. Thanks in advance.
It provides a little more structure. Hitting a subdomain like api.yourwebsite.com should guarentee you're always receiving a JSON response. As a subfolder it might be a bit weird that some parts of your website are returning a web response, and others are returning JSON. yourwebsite.com/api/ -> returns a JSON response yourwebsite.com/blog/ -> returns a web response
yea it's a simple CRUD API. :) We use this exact set up with API resources on a rather large classifieds project. So this explains the basic concept, but this can be repeated for any data a front end app might need.
It's been mentioned but only in replies that if you are on a Windows machine you will need to modify your etc/hosts file to have both the domains accessible
dont know if anyone gives a shit but if you guys are stoned like me during the covid times then you can stream pretty much all of the new movies and series on Instaflixxer. Been binge watching with my gf for the last couple of days =)
@Bruce Sterling Yea, been using InstaFlixxer for since november myself =)
But the storm kept on spreading, it even spread to countries such as Syria, Egypt, Libya, Sudan and many more. It spread so much destruction that I can't even explain in words.
Millions were dying instantly. It was so horrible I wish it would never happen like this. I said to myself what exactly did Israel do to cause such a huge storm. What was in that building that Arab countries were angry about. And when will this horrible storm stop?
🌟please find more about these important dreams of Muhammad Qasim. We are the last generation of this ummah
Thank you so much ..you are really awesome... I was trying to learn API creation....
And here you are doing
Thanks again
It's a pleasure Sameer, I am glad these will be helpful :)
Thanks a lot Quentin. A very nice tutorial. Please include my request as well along with Leon's request. Vue SPA (with vuetify or Quasar) and Laravlel Passport. Kind regards.
hey Sir , you are delivering a great content and extremly well understood , are you expecting please to make a long detailled video for the most used tool like wordpress dev. ? ( php , css ..) to let us learn how to master the themes/plugins customization and creation please ? thank you x 1000 for your content.
hey i am doing html5 and you are helping me
Thank very much!! now I understand how to use API. Thank you!! Thank you!!
Calling env() in your code is a bad practice since env() function is slow. Consider api domain to your config file and call env() there since config gets cached and then use that config variable in your code.
Also, thank you for awesome series, love watching them!
whatever works for you to speed up production or optimise security, sure. :)
This was just 1 slightly better practice than hard coding the URL into the project. I never intended this to go to production. It's a simple learning project.
Easy to understand. Thank you for making this.
Thank you very much
Someone can make this "think" work on windows (preferably with laragon?, i try it with wamp too)
Route::domain('api.peoplefinder.test')
im stuck with this like almost one day and i cant make it work
By the way, nice theoretical lesson (the practice part... i cant do it yet jaja)
P/D: I know quentin is using a mac... but i cant affort that.... maybe if i sell my neightboor kidneys i could buy... naaa... too risky... jaja
:p There are many windows computers that cost the same as a mac.
I am using Laravel valet which automatically registers and points my test domains, but normally on windows you have to set up this domain in the `/etc` file.
This code creates a subdomain which you will also have to set up in the `/etc` file
Route::domain('api.peoplefinder.test')
@@QuentinWatt
I try to undestand my problem, could it be this 4 things
1) windows
2) my version of laravel (7.28.3) dealing with "domain" line
3) Laragon. (i believe is like valet, not linkin obviously)
4) the routing file (its below)
you say i need to set up this
DocumentRoot "C:/laragon/www/peopleFinder/public/"
ServerName peopleFinder.test
ServerAlias *.peopleFinder.test
AllowOverride All
Require all granted
like this? i mean changing this two lines, right?
ServerName api.peopleFinder.test
ServerAlias *.api.peopleFinder.test
Because it doesnt work
It would be great if you will make a video adding Laravel Passport to this project, including password reset. And a Vue SPA as a front end.
I think I'll do something on passport soonish. :)
@@QuentinWatt Please do it especially with Laravel Passport since I still have no Idea how to use it.
Do you have any tutorial on Laravel subdomain application.
That was partly included in this series. Not sure how much detail you are looking for?
@@QuentinWatt My requirement is to make sub-domains in the laravel application like domain.application.com(app.faisal.com).
I've got through this now but there's a couple of changes in the latest versions of the tools that he's using. The syntax for the routes in laravel appears to be different now. Route::domain('api.peoplefinder.test') and Route::domain(env('API_DOMAIN')) worked for me. Postman as a Chrome extension is being retired, but is still available. And sequel pro doesn't support the default authentication with mysql, so you have to change the mysql authentication to legacy, instructions are on stack overflow - stackoverflow.com/questions/51179516/sequel-pro-and-mysql-connection-failed?rq=1
There are many different syntaxes for routes. Mine are not wrong. You have options.
I am not using Postman as a chrome extension, I am using the postman app. Which is not being retired.
Please don't leave comments like this unless you are absolutely sure because these can misinform other people watching my videos. Thank you.
Do you have a tutorial for auth API with token?
Not yet. I will do it soon :)
if you have an error , this video doesn't teach everything, so I suggest Windows Users or Mac, First watch this video: ruclips.net/video/r40yAZAi6PQ/видео.html , another note is that you must write your function in the Laravel Controller , otherwise it would give error as it did for me .
That is incorrect.
You're welcome to download the code for free (link in the description) to find your errors. :)
If you can paste the exact error into the comment section, I can help point you in the right direction.
when i try to make the route::domain('api.peoplefinder.test') on windows ( timestamp 7:07 ), my browser and postman cant reach this site. Is there a different way from windows os?
I am using Laravel Valet which automatically maps my domains. Since you are on a windows computer, you may need to add the sub domain to your hosts file in order to access it.
I have a video on the topic here:
ruclips.net/video/fuiW9tWkzXU/видео.html
Simply add api.peoplefinder.test along with any other URLs you have mapped.
Hi. Thanks for the work. This is a very useful tutorial. I am practicing this tutorial on my local ubuntu server. I was trying to fetch to API using the subdomain version you taught in the tutorial but its showing "this site can't be reached" issue whenever I try to get method. I think it has to something with creating a subdomain in my virtual server or maybe something else. Can you help me resolve the issues?
It sounds like you don't have a local server set up.
I'm not too sure how to do that on ubuntu but I use Laravel Valet on my mac for that. See my tutorials on how to set up Laravel. :)
Nice clear explanation. I think it would be better to use a config file for the API domain that can be cached rather than access the env function directly? It could also concat API prefix and APP_URL ?
whatever works for you to speed up production or optimise security, sure. :)
This was just 1 slightly better practice than hard coding the URL into the project.
hey in the starting code you wrote api.peoplefinder.test but it didnt work for me can you help?
I'd need to know what your error was.
The code is available for free, link in the description. Try set up the project and see where you went wrong.
Domain issue: I had an error by entering Route::domain(value:'api.peoplefinder.test'). Then I removed value and tried with Route::domain('api.peoplefinder.test'). No errors.
the small white text 'value' is only there as a type hint from phpstorm (my editor). It's not part of the code, that's why it looks different.
Route::domain(env('API_DOMAIN')) -> that's what you need to write
@@tamakunay9158 api.peoplefinder.test's server IP address could not be found.
@@theknowledgeworldbyspecial9823 probably you need to have the laravel project in api.peoplefinder.test too by creating the symbolic link for that check google or other tutorial videos
Hi there Quentin! Great videos!! Just a question: Is there a benefit of using subdomain for api instead of /api/? From an SSL perspective, it is more expensive to protect a wildcard instead of a single URL. Thanks in advance.
It provides a little more structure.
Hitting a subdomain like api.yourwebsite.com should guarentee you're always receiving a JSON response.
As a subfolder it might be a bit weird that some parts of your website are returning a web response, and others are returning JSON.
yourwebsite.com/api/ -> returns a JSON response
yourwebsite.com/blog/ -> returns a web response
Oh.. by the way. You can get free SSL certificates with Lets Encrypts.
api.peoplefinder.test’s server IP address could not be found.
You have to use Laravel Valet to set up the test server.
That's done at 1:58
laravel.com/docs/6.x/valet
Awesome work.
Thank you so much 😀
what is this api for? external users who want to use your data or is this a crud system called an api? thx
yea it's a simple CRUD API. :)
We use this exact set up with API resources on a rather large classifieds project.
So this explains the basic concept, but this can be repeated for any data a front end app might need.
Good job!
Man you're just awesome!
Thank you! 😬
Are you planning on doing any more Laravel? Would be great! 👍 Like a full Laravel beginners course?
I do plan on doing a lot more laravel :)
Which version of laravel we are working on ?
The latest at the time of recording which was 5.8
Laravel version ?
This was Laravel 5.8, so not too long ago.
I must say this first episode has given the courage "to make that jump" to valet. Thanks for this awesome tutorial. Thank you!
You're very welcome!