Composer in Laravel: 6 Things You May Not Know

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ม.ค. 2025

ความคิดเห็น • 46

  • @BastianHaustein
    @BastianHaustein 3 ปีที่แล้ว +26

    In my opinion --no-dev ist more about security than saving disk space. You usually use it for packages like the Laravel development bar that should not be accessable on production systems - even for hackers.

    • @LaravelDaily
      @LaravelDaily  3 ปีที่แล้ว +7

      Mm, very good point, didn't think about mentioning it.

    • @alexaverkiyev9099
      @alexaverkiyev9099 3 ปีที่แล้ว +2

      totally agree, dev packages might cause security issues, they should be avoided on the prod server, that's the main point of dev

    • @4KriqN
      @4KriqN 3 ปีที่แล้ว

      Totally agree too. For some packages it is highly recommended to not be installed on production environment, like PHPUnit.

  • @intipontt7490
    @intipontt7490 3 ปีที่แล้ว +1

    composer why to check why a package is required.
    composer install/update --dry-run to check which changes will be made by installing/updating without actually installing/updating anything.
    And of course composer --help or composer --help to get all the options and a brief description of them.

  • @tousonuk
    @tousonuk 3 ปีที่แล้ว +3

    Thanks for filling in the gaps of my knowledge. I knew most of the tips you mentioned but it's always good to get a solid overview. The --no-dev flag on production was not one I use, but I will now!

  • @nabeelyousafpasha
    @nabeelyousafpasha 3 ปีที่แล้ว +2

    I always wanted to understand these and your detailed and very specific elaboration helped me clearing the concepts. Thanks and Respect from Pakistan.

  • @GergelyCsermely
    @GergelyCsermely 3 ปีที่แล้ว +2

    Thank You. It was again very useful.

  • @aisalen
    @aisalen 3 ปีที่แล้ว +1

    Thank you. As always, this is very helpful.

  • @maxpower7735
    @maxpower7735 3 ปีที่แล้ว +2

    One interesting section is autoload and psr-4. You can use it for example for modularity.

  • @rahulxcr
    @rahulxcr 3 ปีที่แล้ว +1

    Great tutorial. Thanks.

  • @nodaddyplease7810
    @nodaddyplease7810 3 ปีที่แล้ว +1

    Hello, i want to give you my own tip i use -vvv for example composer install {some package} -vvv to see how he works behind scenes

  • @hiajayy
    @hiajayy 3 ปีที่แล้ว +1

    Very informative..thankss

  • @tarekalhalabi8776
    @tarekalhalabi8776 3 ปีที่แล้ว

    great information

  • @LuisSolis
    @LuisSolis 3 ปีที่แล้ว +1

    Hi Povilas Korop, I have a question about eloquent, How've eloquent works with temporary tables? Greets from Costa Rica and thanks for your videos.

    • @LaravelDaily
      @LaravelDaily  3 ปีที่แล้ว +1

      I don't think Eloquent works with temporary tables. Or maybe I misunderstood the question.

    • @LuisSolis
      @LuisSolis 3 ปีที่แล้ว

      @@LaravelDaily Thanks, that was my question.

  • @marxrizld9317
    @marxrizld9317 3 ปีที่แล้ว +2

    Does anybody know why laravel breeze is (or should be, perhaps) only installed on dev environment? I'm curious will it still work like login/register scenario when the package itself is not installed on production?

    • @LaravelDaily
      @LaravelDaily  3 ปีที่แล้ว +2

      The logic is that you run breeze:install once and it generates everything you need, locally, and then you don't need that package anymore, may even remove it at all.

    • @marxrizld9317
      @marxrizld9317 3 ปีที่แล้ว

      @@LaravelDaily thanks for your clear explanation...
      To be honest I was thinking --dev would install such beta or nightly build package (as the counter term of --prefer-stable) lol, but this video saved my life 😂

  • @leonvanrijswijk8409
    @leonvanrijswijk8409 3 ปีที่แล้ว

    Thanks very useful. I read about --prefer-stable. This seems a good addition for production?

    • @LaravelDaily
      @LaravelDaily  3 ปีที่แล้ว +1

      Well, I wouldn't trust that those "stable" versions would automatically be really stable by magic. But probably wouldn't hurt.

    • @BastianHaustein
      @BastianHaustein 3 ปีที่แล้ว +1

      As far as I know that is a flag for update or require, but you should never run either of them on production. You should update (perhaps with --prefere-stable) on your dev system, test the results are running, push the composer.log to the production system and than run composer install. The install command does not calculate versions to install, it installs the version that is fixed in the composer.log without asking any questions.

  • @stephensim5478
    @stephensim5478 3 ปีที่แล้ว

    Great tutorial, could u pls make a video for installing laravel package without using terminal command? Im facing some issue where my production server doesn't provide the terminal. Thank you so much.

    • @LaravelDaily
      @LaravelDaily  3 ปีที่แล้ว

      If your server doesn't provide terminal, change the server. Otherwise you will have much more issues in the future.

    • @LaravelDaily
      @LaravelDaily  3 ปีที่แล้ว +1

      @Piotreeeek you would be surprised on what kinds of shared hosting environments people are actually able to install Laravel, by uploading files via FTP or some other voodoo magic. But, as they say, "if you can, doesn't mean you should" :)

    • @stephensim5478
      @stephensim5478 3 ปีที่แล้ว

      Haha, i just solved my issue by updating vendor folder 😆😆

  • @recepgumus2332
    @recepgumus2332 3 ปีที่แล้ว +2

    As I know you should be sure that your local php version is same as server php version while you are pushing composer.lock file. For example, if you have php 7.4 on your local and 7.2 on server, some packages version maybe required php 7.3 or something. Then you wont be able to run composer install on server after you pull composer.lock from your local machine you will get error. Maybe I am wrong but this is happend to me once and I just remove composer.lock on server and then run composer install again .

    • @LaravelDaily
      @LaravelDaily  3 ปีที่แล้ว +5

      My general advice is to ensure that environments you work in - local, staging, production, other teammates - would be as identical as possible, PHP version is one of the parameters here.

  • @john.godstime
    @john.godstime 3 ปีที่แล้ว

    Nice video here, I like. Please sir, do a video on website bandwidth. 🙏

  • @vinsmoke.sanji.4
    @vinsmoke.sanji.4 3 ปีที่แล้ว

    Thank you for your video
    Amazing as all time
    So, what if i want to create dynamic model
    My problem is I stored data in new table for each user
    If we had table called payements_vinsmoke
    Its table payements for user that have vinsmoke as username
    So in this case Its not good practice to create for each user it model
    So is there any solution to handle this
    Warm regards

  • @ahmedhelal174
    @ahmedhelal174 3 ปีที่แล้ว

    Thank you

  • @AjaySingh-rj3cn
    @AjaySingh-rj3cn 3 ปีที่แล้ว

    Exactly what I wants to learn from a long,

  • @AneesKhan-uz4mz
    @AneesKhan-uz4mz 3 ปีที่แล้ว

    @Laravel Daily can you make a video on Laravel Octane ?

    • @LaravelDaily
      @LaravelDaily  3 ปีที่แล้ว

      Currently not in plans, I haven't used it myself, as I don't have even a project where to test it.

  • @newsall3049
    @newsall3049 3 ปีที่แล้ว

    thanks

  • @anisurrahman6634
    @anisurrahman6634 3 ปีที่แล้ว +1

    Nice

  • @smartlinks6483
    @smartlinks6483 3 ปีที่แล้ว

    Hi,
    Can you please explain how laravel upgrade works ?
    I have laravel 6, with let say 2 very less known packages and 3 popular packages like spaties permission, then laravel file manager,etc
    Now I want to upgrade to laravel 8. How do I do that?
    It would be very nice, if you can make a video on that topic please

    • @LaravelDaily
      @LaravelDaily  3 ปีที่แล้ว

      I have a demo video of upgrade: th-cam.com/video/mPBkYdrOEdQ/w-d-xo.html
      So, from Laravel 6 you need to first upgrade to Laravel 7, and then to 8.
      You may also use a service for it called laravelshift.com

    • @smartlinks6483
      @smartlinks6483 3 ปีที่แล้ว +1

      @@LaravelDaily Thanks! I also saw your laravel audit package video, Please do review more packages. It does expands our knowledge. You are like stefan mischook

  • @GamePlayByFaks
    @GamePlayByFaks 3 ปีที่แล้ว

    despite your package is good it is big pain to extract data from it :), mixed static with dynamic bad bad :) even tough I found way to solve it ...

  • @yungifez
    @yungifez 3 ปีที่แล้ว

    I had the wrong idea of --dev

  • @miskith
    @miskith 3 ปีที่แล้ว +2

    composer outdated --direct ... To see only packages defined in composer.json

  • @Hello-mu1et
    @Hello-mu1et 3 ปีที่แล้ว

    read video title like composer in laravel 6 lol Im blind