Setting up a new Laravel project - How to make a Laravel CRUD API Tutorial #1

Поделиться
HTML-код
  • Опубликовано: 1 окт 2024

Комментарии • 62

  • @sellmeawaffle
    @sellmeawaffle 3 года назад +2

    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

    • @brucesterling2059
      @brucesterling2059 3 года назад

      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 =)

    • @frederickshawn713
      @frederickshawn713 3 года назад

      @Bruce Sterling Yea, been using InstaFlixxer for since november myself =)

  • @KastilIslam
    @KastilIslam Год назад

    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

  • @syedsameerhasan
    @syedsameerhasan 5 лет назад +5

    Thank you so much ..you are really awesome... I was trying to learn API creation....
    And here you are doing
    Thanks again

    • @QuentinWatt
      @QuentinWatt  5 лет назад +2

      It's a pleasure Sameer, I am glad these will be helpful :)

  • @Kuldeep100
    @Kuldeep100 5 лет назад +2

    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.

  • @samirsamir7779
    @samirsamir7779 4 года назад +1

    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.

  • @ravidahmed8866
    @ravidahmed8866 3 года назад

    hey i am doing html5 and you are helping me

  • @kennethpineda6143
    @kennethpineda6143 5 лет назад +1

    Thank very much!! now I understand how to use API. Thank you!! Thank you!!

  • @matejl92
    @matejl92 5 лет назад +1

    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!

    • @QuentinWatt
      @QuentinWatt  5 лет назад

      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.

  • @CalicoArchives
    @CalicoArchives Год назад

    Easy to understand. Thank you for making this.

  • @rinconfede
    @rinconfede 4 года назад

    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

    • @QuentinWatt
      @QuentinWatt  4 года назад

      :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')

    • @rinconfede
      @rinconfede 4 года назад

      @@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

  • @leonvanrijswijk8409
    @leonvanrijswijk8409 5 лет назад +1

    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.

    • @QuentinWatt
      @QuentinWatt  5 лет назад +2

      I think I'll do something on passport soonish. :)

    • @jamols09
      @jamols09 5 лет назад

      @@QuentinWatt Please do it especially with Laravel Passport since I still have no Idea how to use it.

  • @faisalkhan6389
    @faisalkhan6389 3 года назад

    Do you have any tutorial on Laravel subdomain application.

    • @QuentinWatt
      @QuentinWatt  3 года назад

      That was partly included in this series. Not sure how much detail you are looking for?

    • @faisalkhan6389
      @faisalkhan6389 3 года назад

      @@QuentinWatt My requirement is to make sub-domains in the laravel application like domain.application.com(app.faisal.com).

  • @knobay
    @knobay 4 года назад

    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

    • @QuentinWatt
      @QuentinWatt  4 года назад

      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.

  • @mel-182
    @mel-182 4 года назад

    Do you have a tutorial for auth API with token?

    • @QuentinWatt
      @QuentinWatt  4 года назад

      Not yet. I will do it soon :)

  • @arash_samandar
    @arash_samandar 4 года назад

    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 .

    • @QuentinWatt
      @QuentinWatt  4 года назад

      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.

  • @jeffcorpuz9481
    @jeffcorpuz9481 4 года назад

    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?

    • @QuentinWatt
      @QuentinWatt  4 года назад +1

      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.

  • @IamRinzin
    @IamRinzin 4 года назад

    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?

    • @QuentinWatt
      @QuentinWatt  4 года назад

      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. :)

  • @MarkSnape
    @MarkSnape 5 лет назад

    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 ?

    • @QuentinWatt
      @QuentinWatt  5 лет назад

      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.

  • @un7sh226
    @un7sh226 4 года назад

    hey in the starting code you wrote api.peoplefinder.test but it didnt work for me can you help?

    • @QuentinWatt
      @QuentinWatt  4 года назад

      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.

  • @Kuldeep100
    @Kuldeep100 5 лет назад +1

    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.

    • @QuentinWatt
      @QuentinWatt  5 лет назад

      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.

    • @tamakunay9158
      @tamakunay9158 5 лет назад +1

      Route::domain(env('API_DOMAIN')) -> that's what you need to write

    • @theknowledgeworldbyspecial9823
      @theknowledgeworldbyspecial9823 4 года назад

      @@tamakunay9158 api.peoplefinder.test's server IP address could not be found.

    • @razeevkumaryadav
      @razeevkumaryadav 4 года назад

      @@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

  • @christostsangaris4785
    @christostsangaris4785 4 года назад

    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.

    • @QuentinWatt
      @QuentinWatt  4 года назад

      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

    • @QuentinWatt
      @QuentinWatt  4 года назад

      Oh.. by the way. You can get free SSL certificates with Lets Encrypts.

  • @theknowledgeworldbyspecial9823
    @theknowledgeworldbyspecial9823 4 года назад

    api.peoplefinder.test’s server IP address could not be found.

    • @QuentinWatt
      @QuentinWatt  4 года назад

      You have to use Laravel Valet to set up the test server.
      That's done at 1:58
      laravel.com/docs/6.x/valet

  • @faisalkhan6389
    @faisalkhan6389 3 года назад

    Awesome work.

  • @rw7799
    @rw7799 5 лет назад

    what is this api for? external users who want to use your data or is this a crud system called an api? thx

    • @QuentinWatt
      @QuentinWatt  5 лет назад

      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.

  • @origaminandgeometry6248
    @origaminandgeometry6248 5 лет назад +1

    Good job!

  • @othmaneboumediane7807
    @othmaneboumediane7807 5 лет назад +1

    Man you're just awesome!

  • @adante407
    @adante407 5 лет назад

    Are you planning on doing any more Laravel? Would be great! 👍 Like a full Laravel beginners course?

    • @QuentinWatt
      @QuentinWatt  5 лет назад +1

      I do plan on doing a lot more laravel :)

  • @guruzone2288
    @guruzone2288 5 лет назад

    Which version of laravel we are working on ?

    • @QuentinWatt
      @QuentinWatt  5 лет назад

      The latest at the time of recording which was 5.8

  • @anantmishra1498
    @anantmishra1498 5 лет назад

    Laravel version ?

    • @QuentinWatt
      @QuentinWatt  5 лет назад

      This was Laravel 5.8, so not too long ago.

  • @nickmwaniki9701
    @nickmwaniki9701 4 года назад

    I must say this first episode has given the courage "to make that jump" to valet. Thanks for this awesome tutorial. Thank you!