# Composer - Pros & Cons

# Composer basics

<div class="MjjYud" id="bkmrk-composer-https%3A%2F%2Fget" style="color: rgb(31, 31, 31); font-family: Arial, sans-serif; font-size: medium; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><div class="A6K0A" data-rpos="0"><div class="wHYlTd Ww4FFb tF2Cxc asEBEc vt6azd" data-hveid="CA4QAA" data-ved="2ahUKEwj_8K_j7rSRAxVQxjgGHQ6INA8QFSgAegQIDhAA" jsaction="QyLbLe:OMITjf;ewaord:qsYrDe;xd28Mb:A6j43c" jscontroller="SC7lYd" lang="en" style="font-family: Arial, sans-serif; font-size: 14px; line-height: 22px; margin: 0px 0px 30px; border-radius: 0px; border-width: 0px; background-color: rgb(255, 255, 255); box-shadow: none; position: relative; max-width: 100%; width: inherit;"><div class="N54PNb BToiNc" data-snc="nRjbIe" style="display: flex; flex-direction: column; justify-content: start; position: relative;"><div class="kb0PBd A9Y9g jGGQ5e" data-snf="x5WNvb" data-snhf="0" style="display: block; flex: 1 1 100%; min-width: 0px;"><div class="yuRUbf" style="font-weight: normal; font-size: small; line-height: 1.58;"><div class="b8lM7" style="display: flex; flex-direction: column-reverse;"><span class="V9tjod" style="text-wrap: wrap; transform: scaleY(-1);">[  
<div class="notranslate ESMNde HGLrXd ojE3Fb" style="display: inline-block; text-size-adjust: none; padding: 0px; max-width: calc(100% - 20px); text-wrap: wrap; transform: scaleY(-1);"><div class="q0vns" style="display: flex; padding: 0px; overflow: hidden; align-items: center;"><div aria-hidden="true" class="eqA2re NjwKYd Vwoesf" style="vertical-align: middle; display: inline-block; margin-right: 0px;"></div><div class="CA5RN" style="overflow: hidden;"><div><span class="VuuXrf" style="color: rgb(32, 33, 36); font-size: 14px; display: block; line-height: 20px; white-space: nowrap; overflow-x: hidden; text-overflow: ellipsis; width: auto;">Composer</span></div><div class="byrV5b" style="align-items: center; display: flex; flex-direction: row;"><cite class="qLRx3b tjvcx GvPZzd cHaqb" role="text" style="color: rgb(39, 41, 42); font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 18px; max-width: max-content; width: 248.156px;">https://getcomposer.org<span class="ylgVCe ob9lvb" role="text" style="color: rgb(22, 23, 24);"> › doc › 01-basic-usage</span></cite></div></div></div></div>](https://getcomposer.org/doc/01-basic-usage.md)</span><div class="B6fmyf byrV5b Mg1HEd" style="align-items: center; display: flex; flex-direction: row; max-height: 0px; position: relative; top: 19px; visibility: hidden; height: auto;"><div class="HGLrXd ojE3Fb" style="display: inline-block; text-size-adjust: none; padding: 0px; max-width: calc(100% - 20px);"><div class="q0vns" style="display: flex; padding: 0px; overflow: hidden; align-items: center;"><div><div class="eqA2re NjwKYd" style="margin-right: 0px; height: 18px; width: 18px;">  
</div></div><div class="CA5RN" style="overflow: hidden;"><div>  
</div><div class="byrV5b" style="align-items: center; display: flex; flex-direction: row;">  
</div></div></div></div><div class="csDOgf BCF2pd ezY6nb L48a4c" style="display: inline; visibility: visible; margin-left: 8px; position: relative; height: 18px; margin-top: 16px;"><div data-ved="2ahUKEwj_8K_j7rSRAxVQxjgGHQ6INA8Q2esEegQIDBAJ" id="bkmrk--1" jsaction="rcuQ6b:npT2md;h5M12e" jscontroller="i8S0p" jsdata="l7Bhpb;_;BV86ab_aJ9CM4-EPjpDSeQ12" jsslot=""><div aria-describedby="_BV86ab_aJ9CM4-EPjpDSeQ_37" aria-label="About this result" class="MJ8UF iTPLzd rNSxBe eY4mx lUn2nc" role="button" style="padding-left: 0px; padding-bottom: 20px; padding-right: 12px; cursor: pointer; top: 0px; line-height: 16px; left: 0px; width: 28px; z-index: 1; outline: 0px; position: absolute;" tabindex="0"><span class="D6lY4c" style="height: 22px; width: 22px; position: absolute; border-radius: 11px; top: -1px;"><span class="xTFaxe z1asCe" style="display: inline-block; fill: currentcolor; height: 18px; line-height: 18px; position: relative; width: 18px; top: 3px; color: rgb(77, 81, 86);"><svg aria-hidden="true" focusable="false" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"></path></svg></span></span></div></div></div></div></div></div></div><div class="kb0PBd A9Y9g" data-sncf="1" data-snf="nke7rc" style="display: block; flex: 1 1 100%; min-width: 0px;"><div class="VwiC3b yXK7lf p4wth r025kc Hdw6tb" style="font-family: Arial, sans-serif; font-size: 14px; font-weight: 400; line-height: 22px; color: rgb(31, 31, 31); word-break: break-word; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; -webkit-line-clamp: 2;">To start using *Composer* in your project, all you need is a *composer*.json file. This file describes the dependencies of your project and may contain other ...[See more](https://getcomposer.org/doc/01-basic-usage.md#:~:text=To%20start%20using%20Composer%20in,contain%20other%20metadata%20as%20well.)</div></div><div class="kb0PBd" data-sncf="2" data-snf="gdePb" style="display: block; flex: 0 0 auto; padding-top: 4px;"><div role="list">[<div class="jEYSNd" style="border-image: none 100% / 1 / 0 stretch; border-radius: 9999px; padding: 0px 12px; position: relative; display: inline-flex; justify-self: center; align-items: center; height: 30px; border: 1.2px solid rgb(71, 71, 71);"><div class="uyS0S" style="background-color: rgb(5, 40, 97); border-radius: 9999px; opacity: 0; position: absolute; inset: 0px;">  
</div><span class="qXOWAb" style="font-family: Arial, sans-serif; font-size: 12px; font-weight: 500; line-height: 16px; color: rgb(0, 40, 170);">JSON schema</span></div>](https://getcomposer.org/doc/04-schema.md)[<div class="jEYSNd" style="border-image: none 100% / 1 / 0 stretch; border-radius: 9999px; padding: 0px 12px; position: relative; display: inline-flex; justify-self: center; align-items: center; height: 30px; border: 1.2px solid rgb(71, 71, 71);"><div class="uyS0S" style="background-color: rgb(5, 40, 97); border-radius: 9999px; opacity: 0; position: absolute; inset: 0px;">  
</div><span class="qXOWAb" style="font-family: Arial, sans-serif; font-size: 12px; font-weight: 500; line-height: 16px; color: rgb(0, 40, 170);">Libraries</span></div>](https://getcomposer.org/doc/02-libraries.md)[<div class="jEYSNd" style="border-image: none 100% / 1 / 0 stretch; border-radius: 9999px; padding: 0px 12px; position: relative; display: inline-flex; justify-self: center; align-items: center; height: 30px; border: 1.2px solid rgb(71, 71, 71);"><div class="uyS0S" style="background-color: rgb(5, 40, 97); border-radius: 9999px; opacity: 0; position: absolute; inset: 0px;">  
</div><span class="qXOWAb" style="font-family: Arial, sans-serif; font-size: 12px; font-weight: 500; line-height: 16px; color: rgb(0, 40, 170);">Versions and constraints</span></div>](https://getcomposer.org/doc/articles/versions.md)[<div class="jEYSNd" style="border-image: none 100% / 1 / 0 stretch; border-radius: 9999px; padding: 0px 12px; position: relative; display: inline-flex; justify-self: center; align-items: center; height: 30px; border: 1.2px solid rgb(71, 71, 71);"><div class="uyS0S" style="background-color: rgb(5, 40, 97); border-radius: 9999px; opacity: 0; position: absolute; inset: 0px;">  
</div><span class="qXOWAb" style="font-family: Arial, sans-serif; font-size: 12px; font-weight: 500; line-height: 16px; color: rgb(0, 40, 170);">Autoloader optimization</span></div>](https://getcomposer.org/doc/articles/autoloader-optimization.md)</div></div></div></div></div><span data-csim="" id="bkmrk--2"></span></div><div class="MjjYud" id="bkmrk--3" style="color: rgb(31, 31, 31); font-family: Arial, sans-serif; font-size: medium; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">  
</div><div id="bkmrk-composer-basics%C2%A0revo" style="color: rgb(31, 31, 31); font-family: Arial, sans-serif; font-size: medium; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><div class="ULSxyf" style="margin-bottom: 44px;"><div class="MjjYud"><div class="Wm5I1e" id="bkmrk-composer-basics%C2%A0revo-1" jsname="ZLxsqf" style="position: relative;"><div class="YzCcne" data-mcp="18" data-mcpr="" data-mg-cp="YzCcne" style="--m3c1: #0b57d0; --m3c2: rgba(245,248,255,0.5); --m3c3: #fff; --m3c5: #f5f8ff; --m3c6: #e5edff; --m3c7: #d3e3fd; --m3c9: #001d35; --m3c10: #001d35; --m3c11: #001d35; --m3c12: #001d35; --m3c13: #a3c9ff; --m3c14: #001d35; --m3c15: #052861; --m3c16: #001d35; --m3c17: #a9acaa; --m3c18: #446eff; --m3c19: #b1c5ff; --m3c20: #c8ecff; --m3c21: #a6c8ff; --m3c22: #d3e3fd; --m3c23: #3179ed; margin-bottom: 30px;"><div class="hdzaWe" data-is-desktop="1" jscontroller="" style="font-family: 'Google Sans', Arial, sans-serif; position: relative;"><div class="EyBRub jUja0e" data-adl="" data-aim="1" data-al="AI overview is ready" data-ale="" data-attnms="ec" data-fsid="B2Jtyd" data-kpfbbcast="" data-lfid="ChxjMe" data-loaded="1" data-mlro="0a4J8Z7VR-29FwEdhYhuvhL0hl2TpVtmdECYhJ-eH0meN6fcUIwiTHkrokTGHalrbnPekXy2j-wEOHObL5UasfaFnRXTiVSUMD9i4F3hncalvlh2KaEmvvjIBsOALCtZCgTZ" data-mlros="ITnWS6k29fM" data-mrc="CAI4kANQAA" data-phe="" data-q="composer basics" data-snr="" data-swyc="" data-umr="" id="bkmrk-composer-basics%C2%A0revo-2" jsaction="rcuQ6b:npT2md;cCjcXd:zxhxA;JJ8and:ucoWJf;MzocBc:bjCgVe;Yi1BGf:TSmMNc;mgqo8b:MWaDUe;o591zd:spktNb;uRBWFb:eXlMAd;lbJ4Zb:unmwI;Wyhgxe:Us8Dve" jscontroller="EYwa3d" jsmodel="gbgkRc nHLHI ja6yPb Pwo57d TPfxRd C6pisf JwXdLe" jsname="dEwkXc"><div data-hveid="CBsQAg" data-ved="2ahUKEwj_8K_j7rSRAxVQxjgGHQ6INA8QqMoKegQIGxAC"><div class="yf" data-async-type="folsrch" data-jiis="up" data-lhcontainer="1" data-ved="2ahUKEwj_8K_j7rSRAxVQxjgGHQ6INA8Q54gQegQIGxAD" eid="Bl86aYbEBP7z4-EP26LJyA8" id="bkmrk-composer-basics%C2%A0revo-3" jsname="E6JrNd" style="min-height: 400px;"><div data-processed="true" data-subtree="mfc" data-trnct="true" id="bkmrk-composer-basics%C2%A0revo-4"><div jsaction="rcuQ6b:npT2md;d1Ff8d:QrvFH;OiPALb:mMVKRd;plqK0:iD1eHf" jscontroller="AkrxPe"><div class="h7Tj7e zc75bb" data-fh="" style="overflow: visible; position: relative; max-height: none; outline: 0px; min-height: auto;" tabindex="-1"><div class="D5ad8b" id="bkmrk-composer-basics%C2%A0revo-5"><div class="s7d4ef X6JNf" decode-data-ved="1" jsname="V3qe9d" style="background: unset !important; min-height: 399px;"><div jsaction="rcuQ6b:npT2md;CDsptd:xS7bof;FJQNc:i4GAQc;iZ6HYb:QTfXPb;r78Cnb:GlFhm" jscontroller="pJyqm" jsmodel="FRbqE"><div><div data-container-id="content-placeholder"><div class="s7d4ef" data-processed="true"><div class="RJPOee mNfcNd" style="animation: auto ease 0s 1 normal none running none !important; position: relative;"><div data-hveid="CAIQBg" data-ve-view="" data-ved="2ahUKEwiG38nj7rSRAxX--TgGHVtREvkQ2b4KegQIAhAG"><div class="Pqkn2e rNSxBe" data-ved="2ahUKEwiG38nj7rSRAxX--TgGHVtREvkQ274KegQIAhAH" id="bkmrk-composer-basics%C2%A0revo-6" jsname="HKDuG" style="padding-bottom: 20px; font-family: Arial, sans-serif; font-size: 16px; line-height: 24px;"><div class="jloFI GkDqAd" style="padding-left: 0px; padding-right: 0px; font-family: 'Google Sans', Arial, sans-serif; font-style: normal; font-weight: 400; font-size: 16px; line-height: 24px; color: rgb(0, 29, 53); position: relative;"><div data-container-id="model-response-placeholder"><div data-processed="true"><div data-hveid="CAIQCg" data-ved="2ahUKEwiG38nj7rSRAxX--TgGHVtREvkQ7uAMegQIAhAK"><div jsaction="rcuQ6b:npT2md;YbaXcb:oMGkAb;DfLsBc:N6Mv3e;Wyhgxe:daG3j;rkJ0hb:daG3j;j92B8:N6Mv3e" jscontroller="qwbW4b" jsmodel="k8Azyd E23uIf" jsname="Y0vxu"><div><div style="position: relative;"><div class="LT6XE" style="display: flow-root; color: rgb(10, 10, 10); --m3c9: #0a0a0a; --m3c11: #0a0a0a; overflow-y: clip; position: relative; overflow-wrap: break-word; max-width: 100%;"><div class="RJPOee EIJn2" style="animation: auto ease 0s 1 normal none running none !important; color: rgb(10, 10, 10);"><div class="pOOWX" data-lht="2729" data-rl="en" jsname="dvXlsc"><div class="RJPOee oQOpie dRgSPb" style="animation: auto ease 0s 1 normal none running none !important; height: 48px;"><div style="display: flex; justify-content: space-between; position: relative;"><div data-container-id="tts-container-placeholder" style="display: contents;"><div data-processed="true" style="display: contents;"><div data-attc="false" data-processed="true" jsaction="rcuQ6b:npT2md;NM5wd:kwsnR" jscontroller="vr6ZBb"></div></div></div></div></div><div class="Ii22Cf" data-oto="48" data-tr-cl="magi-translate" data-tr-sl="en" data-tr-tl="hi" jsaction="rcuQ6b:npT2md" jscontroller="MN6hqd" jsname="lcCwgb"><div jsname="kj7T5c"><div id="bkmrk--4"></div><div jsname="PLkxOb"><div><section><div data-host-wiz-contract-name="gws_wizbind" jsaction="rcuQ6b:npT2md" jscontroller="WOnCB" jsdata="i50kQ;_;Bl86aYbEBP7z4-EP26LJyA83"><div jsname="coFSxe"><div class="qRuFed" data-complete="true"><div class="CKgc1d" data-scope-id="turn" jscontroller="uUCgYd" jsmodel="CPTaDd LUQCCe pRMv2d" jsname="CS7uPe" jsuid="Rb9aF_0"><div class="FkX2oe" data-aimmrs="true" data-hveid="CAAQAA" data-subtree="aimc" data-ved="2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQ2O0OegQIABAA" data-wiz-uids="Rb9aF_2" decode-data-ved="1" dir="ltr" jscontroller="nfCumd" jsmodel="LUQCCe pRMv2d" jsuid="Rb9aF_1" style="unicode-bidi: isolate; position: relative; font-family: 'Google Sans', Roboto, Arial, sans-serif; font-size: 16px; line-height: 24px; color: rgb(10, 10, 10); font-weight: 400; --m3c9: #0a0a0a; --m3c11: #0a0a0a; display: flex; flex-direction: row;"><div class="pWvJNd" jscontroller="zp3Dsd" jsuid="Rb9aF_3" style="width: 651.862px;"><div jsname="s7e4Od"><div data-container-id="4" style="display: contents;">  
</div></div><div class="mZJni" data-container-id="main-col" data-ved="2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQ3KYQegQIABAB" data-xid="VpUvz" dir="ltr" jscontroller="Aoijq" jsuid="Rb9aF_4" style="unicode-bidi: isolate; width: 631.987px; max-width: 632px;"><div data-container-id="5" style="margin-top: 0px; margin-bottom: 0px; display: contents;"><div class="Y3BBE" data-hveid="CAEQAA" data-processed="true" data-sfc-cp="" jsaction="rcuQ6b:&Rb9aF_7|npT2md" jscontroller="zcfIf" jsuid="Rb9aF_7" style="font-family: 'Google Sans', Roboto, Arial, sans-serif; font-size: 16px; line-height: 24px; overflow-wrap: break-word; margin: 0px 0px 20px; color: rgb(10, 10, 10);"><div class="QzGOQd" data-processed="true" jscontroller="V5rKoc" jsuid="Rb9aF_8" style="float: right;"><div data-processed="true" data-subtree="aimfl,mfl" jscontroller="v48bt" jsuid="Rb9aF_9" style="display: contents;"><div class="PwvzCf WEeWWe" data-processed="true" data-wiz-uids="Rb9aF_b,Rb9aF_c" jsaction="rcuQ6b:&Rb9aF_a|npT2md" jscontroller="CEabdc" jsuid="Rb9aF_a" style="display: inline-flex; overflow: hidden; justify-content: center; border-radius: 16px; margin-left: 16px; max-width: 120px; max-height: 120px;"><div data-processed="true"><div class="QwWKjd" data-im="[0,"ZBAWZlu3qAKAwM",["https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSjRkjUyNKKj8QstluJVFlcM1lM3zRymUpZoYAaWlKSDnNWR8FQD5hOUGExoubVPz40XJgX8So2",200,240],["https://blog-assets.solidworks.com/uploads/sites/2/2017/06/composer1.png",550,990],{"2003":[null,"ZHzqIm8npBFEaM","https://blogs.solidworks.com/solidworksblog/2017/06/learn-basics-solidworks-composer.html","Learn the basics of SOLIDWORKS Composer",null,null,null,null,null,null,null,null,"blogs.solidworks.com",null,null,null,null,"blogs.solidworks.com"]}]" data-processed="true" data-ssid="svim" data-sv-cpt="4" data-sve="" data-ved="2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQn7IPegQIARAB" id="bkmrk--5" jsaction="click:&Rb9aF_a|T2P31d" jsuid="Rb9aF_b" role="button" style="outline: 0px;" tabindex="0"></div></div></div></div></div>[Composer basics](https://www.google.com/search?q=Composer+basics&oq=composer+basics&gs_lcrp=EgZjaHJvbWUyCggAEEUYFhgeGDkyBwgBEAAYgAQyCAgCEAAYFhgeMggIAxAAGBYYHjIICAQQABgWGB4yCAgFEAAYFhgeMgoIBhAAGAoYFhgeMggIBxAAGBYYHjIICAgQABgWGB4yCAgJEAAYFhge0gEIMTkyN2owajeoAgCwAgA&sourceid=chrome&ie=UTF-8&mstk=AUtExfDNRmLbpRL42uA4wmKxDpK5P0obg_UF98bUXq-y5SBOgs1lXg8WwHYgcAgDe2ixABk0ja_bOoBxDSQorJbf1TMgSWuSVYUPRngAu-cqTKA1UtkEz2YNYKd77PesbFAdiw0yK-hT6APc5gOl4lcAYhAHZmyQS_QBbU1MnMMto322xhqdNXdNj5J2VicI6GO0wST-h6qIBoRhZC_qhO3IWvxR-FCWFV09glgteGcXduC7kwJ8Ws5KIUokhHM-uNLkiadRjlkoHKmLUzIoy5c93Xhc&csui=3&ved=2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQgK4QegQIARAD) revolve around it being <mark class="HxTRcb" data-processed="true" style="color: rgb(0, 29, 53); border-radius: 4px; background: linear-gradient(90deg, rgb(211, 227, 253) 50%, rgba(0, 0, 0, 0) 50%) 75% 0px / 200% 100% no-repeat scroll padding-box border-box rgba(0, 0, 0, 0); padding: 0px 2px; font-weight: 500; animation: 0.75s cubic-bezier(0.05, 0.7, 0.1, 1) 0.25s 1 normal forwards running highlight-animation;">a **dependency manager for PHP**</mark>, letting you declare libraries your project needs in a `composer.json` file, and then automatically installing, updating, and autoloading them via simple command-line tools like `composer install` and `composer require`, saving immense time by managing third-party code (like Guzzle, PHPUnit) so you don't have to manually find and manage them. It works per-project, creating a `vendor` directory and an `autoload.php` file for seamless class loading, similar to npm for JavaScript or Bundler for Ruby.<span class="uJ19be notranslate" data-processed="true" data-wiz-uids="Rb9aF_l,Rb9aF_m,Rb9aF_n"><span class="vKEkVd" data-animation-atomic="" data-processed="true" style="white-space: nowrap; position: relative;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="fd9c2fd1-2e94-4c5d-8a5f-f4a4e4427a9f" data-processed="true" data-ved="2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQye0OegQIARAF" data-wiz-attrbind="disabled=Rb9aF_l/C5gNJc;class=Rb9aF_l/UpSNec;" style="margin: 0px 6px 0px 0px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div><div class="Y3BBE" data-hveid="CAIQAA" data-processed="true" data-sfc-cp="" jsaction="rcuQ6b:&Rb9aF_t|npT2md" jscontroller="zcfIf" jsuid="Rb9aF_t" style="font-family: 'Google Sans', Roboto, Arial, sans-serif; font-size: 16px; line-height: 24px; overflow-wrap: break-word; margin: 10px 0px 20px; color: rgb(10, 10, 10);">This video provides a beginner-friendly introduction to Composer: <div class="" data-processed="true" data-wiz-uids="Rb9aF_v,Rb9aF_w" jscontroller="uDeH3" jsuid="Rb9aF_u"><div data-hveid="CAIQAQ" data-processed="true" data-ved="2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQ-bUQegQIAhAB"><div data-processed="true"><div class="Q2WBBe" data-processed="true" jsuid="Rb9aF_w" style="container-type: inline-size; display: flex; flex-direction: column; background-color: rgb(243, 245, 246); margin-top: 12px; border-radius: 16px;"><div aria-label="" class="r0hyfc" data-animation-nesting="" data-processed="true" data-ved="2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQypYSegQIAhAC" jsuid="Rb9aF_v" style="overflow: hidden; position: relative; border-radius: 16px 16px 0px 0px; width: 631.987px; height: 353.906px; outline: 0px;" tabindex="-1"><div class="RtAO3b" data-processed="true" data-sfc-cp="" data-wiz-uids="Rb9aF_y" jsaction="rcuQ6b:&Rb9aF_x|npT2md" jscallback="gfNXHe:&Rb9aF_u:U8wGUb" jscontroller="wMmv4c" jsuid="Rb9aF_x" style="width: 631.987px; height: 353.906px;"><div class="nrdPJf" data-processed="true" data-ved="2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQtbEQegQIAhAD" jsaction="click:&Rb9aF_x|T2P31d" jsuid="Rb9aF_y" role="button" style="cursor: pointer; width: 631.987px; height: 353.906px; outline: 0px;" tabindex="0"><div class="n7j80c YkW4Kb" data-processed="true" jscontroller="ItMuwb" jsuid="Rb9aF_z" style="z-index: 2; border-radius: 100px; bottom: 12px; height: 4px; left: 12px; position: absolute; width: calc(100% - 24px); --segment-bar-offset: 12px;"><div class="llCCib" data-processed="true" style="transform: translateX(-50%); width: fit-content; align-items: center; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255); opacity: 0.85; border-radius: 100px; color: rgb(31, 31, 31); display: flex; flex-direction: row; font-size: 12px; gap: 4px; line-height: 1.33; padding: 2px 8px; position: absolute; top: -27px; white-space: nowrap; left: 30.3937px;"><svg fill="currentColor" height="12" viewbox="0 0 12 12" width="12" xmlns="http://www.w3.org/2000/svg"><path d="M3.5 2.7611V9.2386C3.5 9.77772 4.10085 10.0993 4.54942 9.80023L9.40755 6.56148C9.80832 6.2943 9.80832 5.70539 9.40755 5.43821L4.54942 2.19946C4.10085 1.90041 3.5 2.22198 3.5 2.7611Z"></path></svg><span data-processed="true">1m</span></div><div class="s3ITrd" data-processed="true" style="background: none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255); opacity: 0.85; display: flex; height: 3.99375px; justify-content: center; position: absolute; z-index: 1; left: 0px; width: 60.7875px;"><div class="PoLW7d" data-processed="true" style="position: absolute; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; border-top: 2.4px solid rgb(255, 255, 255); top: -7px;">  
</div></div></div><div class="dumoDb YkW4Kb" data-processed="true" style="z-index: 2; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.6); border-radius: 100px; cursor: pointer; position: absolute; right: 14px; top: 12px;"><div class="CaQWce" data-processed="true" jscontroller="sRLmTc" jsuid="Rb9aF_10" style="align-items: center; color: rgb(255, 255, 255); display: flex; height: 20px; justify-content: center; transform: rotate(45deg); width: 20px;"><svg fill="currentColor" height="18px" viewbox="0 -960 960 960" width="18px" xmlns="http://www.w3.org/2000/svg"><path d="M480-120 300-300l58-58 122 122 122-122 58 58-180 180ZM358-598l-58-58 180-180 180 180-58 58-122-122-122 122Z" fill="currentColor"></path></svg></div></div></div></div></div><div data-processed="true">[<div class="RhEuY" data-processed="true" style="display: flex; padding: 16px 12px 12px; gap: 8px; align-items: center;"><div class="SWvopd" data-processed="true" jscontroller="aNJZAb" jsuid="Rb9aF_11" style="height: fit-content; width: fit-content; margin-bottom: 2px; position: relative;"><div class="Lki2rc" data-processed="true" style="width: 20px; height: 20px; line-height: 20px;"><div aria-hidden="true" class="U9BD8 Wsaimf QyEYne" data-processed="true" jscontroller="Cky8Oc" jsuid="Rb9aF_12" style="width: 19.9875px; height: 19.9875px; line-height: 16px; display: flex; flex-shrink: 0; align-items: center; justify-content: center; overflow: hidden; background-color: rgb(255, 255, 255); border-radius: 50%;"></div></div><div class="JccCTc xG6cCf" data-processed="true" style="position: absolute; bottom: -4px; right: -4px; border-radius: 50%; line-height: 10px; padding: 2px; background-color: rgb(255, 255, 255); width: 10px; height: 10px;"><div aria-hidden="true" class="U9BD8 Wsaimf QyEYne" data-processed="true" jscontroller="Cky8Oc" jsuid="Rb9aF_13" style="width: 9.99375px; height: 9.99375px; line-height: 16px; display: flex; flex-shrink: 0; align-items: center; justify-content: center; overflow: hidden; background-color: rgb(255, 255, 255); border-radius: 50%;"></div></div></div><div data-processed="true"><div class="SrjfCd" data-processed="true" style="color: rgb(31, 31, 31); font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">StudyStream+</div><div class="Pcl3Vd" data-processed="true" style="color: rgb(31, 31, 31); letter-spacing: 0px; font-size: 11px; line-height: 13px;">YouTube • 25 Apr 2016</div></div></div>](https://www.youtube.com/watch?v=I6wm15OWyqg&t=1)</div></div></div></div></div></div><div class="Fsg96" data-processed="true" data-sfc-cp="" jsaction="rcuQ6b:&Rb9aF_14|npT2md" jscontroller="KHhJQ" jsuid="Rb9aF_14">  
</div><div aria-level="3" class="otQkpb" data-animation-nesting="" data-processed="true" data-sfc-cp="" jscontroller="a7qCn" jsuid="Rb9aF_15" role="heading" style="color: rgb(0, 29, 53); font-family: 'Google Sans', Roboto, Arial, sans-serif; font-size: 20px; line-height: 28px; margin: 20px 0px 10px; font-weight: 600;">Core Concepts &amp; Workflow:<span class="txxDge notranslate" data-processed="true" data-wiz-uids="Rb9aF_16,Rb9aF_17,Rb9aF_18" style="visibility: hidden;"><span class="vKEkVd" data-animation-atomic="" data-processed="true" style="white-space: nowrap; position: relative;"><button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="82325233-a2e4-417b-9fa1-01a56be7c1d2" data-processed="true" data-ved="2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQye0OegQIAxAA" data-wiz-attrbind="disabled=Rb9aF_16/C5gNJc;class=Rb9aF_16/UpSNec;" style="margin: 0px 6px 0px 0px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div>1. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Dependency Declaration**: Define your project's external libraries (packages) in `composer.json` (e.g., `ramsey/uuid` for UUIDs, `guzzlehttp/guzzle` for HTTP requests).</span>
2. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Installation**: Run `composer install` in your project's root directory to download and install declared dependencies into the `vendor` folder, respecting versions in `composer.lock` if it exists, or creating it if not.</span>
3. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Adding New Packages**: Use `composer require vendor/package-name` to add a new library, which updates `composer.json`, `composer.lock`, and installs the package.</span>
4. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**[Autoloading](https://www.google.com/search?q=Autoloading&oq=composer+basics&gs_lcrp=EgZjaHJvbWUyCggAEEUYFhgeGDkyBwgBEAAYgAQyCAgCEAAYFhgeMggIAxAAGBYYHjIICAQQABgWGB4yCAgFEAAYFhgeMgoIBhAAGAoYFhgeMggIBxAAGBYYHjIICAgQABgWGB4yCAgJEAAYFhge0gEIMTkyN2owajeoAgCwAgA&sourceid=chrome&ie=UTF-8&mstk=AUtExfDNRmLbpRL42uA4wmKxDpK5P0obg_UF98bUXq-y5SBOgs1lXg8WwHYgcAgDe2ixABk0ja_bOoBxDSQorJbf1TMgSWuSVYUPRngAu-cqTKA1UtkEz2YNYKd77PesbFAdiw0yK-hT6APc5gOl4lcAYhAHZmyQS_QBbU1MnMMto322xhqdNXdNj5J2VicI6GO0wST-h6qIBoRhZC_qhO3IWvxR-FCWFV09glgteGcXduC7kwJ8Ws5KIUokhHM-uNLkiadRjlkoHKmLUzIoy5c93Xhc&csui=3&ved=2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQgK4QegQIBBAE)**: Include `require 'vendor/autoload.php';` at the top of your main PHP file to automatically load classes from installed packages, eliminating manual `require` statements.</span>
5. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Updating/Managing**: Use `composer update` to find newer versions of packages, and `composer update vendor/package` to update specific ones.</span><span class="uJ19be notranslate" data-processed="true" data-wiz-uids="Rb9aF_23,Rb9aF_24,Rb9aF_25"><span class="vKEkVd" data-animation-atomic="" data-processed="true" style="white-space: nowrap; position: relative;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="cc92e104-4ad9-46b4-b724-ef7829a6eb93" data-processed="true" data-ved="2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQye0OegQIBBAG" data-wiz-attrbind="disabled=Rb9aF_23/C5gNJc;class=Rb9aF_23/UpSNec;" style="margin: 0px 6px 0px 0px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span>

<div class="Y3BBE" data-hveid="CAUQAA" data-processed="true" data-sfc-cp="" jsaction="rcuQ6b:&Rb9aF_2b|npT2md" jscontroller="zcfIf" jsuid="Rb9aF_2b" style="font-family: 'Google Sans', Roboto, Arial, sans-serif; font-size: 16px; line-height: 24px; overflow-wrap: break-word; margin: 10px 0px 20px; color: rgb(10, 10, 10);">You can watch this video to see how to use Composer to install packages: <div class="" data-processed="true" data-wiz-uids="Rb9aF_2d,Rb9aF_2e" jscontroller="uDeH3" jsuid="Rb9aF_2c"><div data-hveid="CAUQAQ" data-processed="true" data-ved="2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQ-bUQegQIBRAB"><div data-processed="true"><div class="Q2WBBe" data-processed="true" jsuid="Rb9aF_2e" style="container-type: inline-size; display: flex; flex-direction: column; background-color: rgb(243, 245, 246); margin-top: 12px; border-radius: 16px;"><div aria-label="" class="r0hyfc" data-animation-nesting="" data-processed="true" data-ved="2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQypYSegQIBRAC" jsuid="Rb9aF_2d" style="overflow: hidden; position: relative; border-radius: 16px 16px 0px 0px; width: 631.987px; height: 353.906px; outline: 0px;" tabindex="-1"><div class="RtAO3b" data-processed="true" data-sfc-cp="" data-wiz-uids="Rb9aF_2g" jsaction="rcuQ6b:&Rb9aF_2f|npT2md" jscallback="gfNXHe:&Rb9aF_2c:U8wGUb" jscontroller="wMmv4c" jsuid="Rb9aF_2f" style="width: 631.987px; height: 353.906px;"><div class="nrdPJf" data-processed="true" data-ved="2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQtbEQegQIBRAD" jsaction="click:&Rb9aF_2f|T2P31d" jsuid="Rb9aF_2g" role="button" style="cursor: pointer; width: 631.987px; height: 353.906px; outline: 0px;" tabindex="0"><div class="n7j80c YkW4Kb" data-processed="true" jscontroller="ItMuwb" jsuid="Rb9aF_2h" style="z-index: 2; border-radius: 100px; bottom: 12px; height: 4px; left: 12px; position: absolute; width: calc(100% - 24px); --segment-bar-offset: 12px;"><div class="llCCib" data-processed="true" style="transform: translateX(-50%); width: fit-content; align-items: center; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255); opacity: 0.85; border-radius: 100px; color: rgb(31, 31, 31); display: flex; flex-direction: row; font-size: 12px; gap: 4px; line-height: 1.33; padding: 2px 8px; position: absolute; top: -27px; white-space: nowrap; left: 164.156px;"><svg fill="currentColor" height="12" viewbox="0 0 12 12" width="12" xmlns="http://www.w3.org/2000/svg"><path d="M3.5 2.7611V9.2386C3.5 9.77772 4.10085 10.0993 4.54942 9.80023L9.40755 6.56148C9.80832 6.2943 9.80832 5.70539 9.40755 5.43821L4.54942 2.19946C4.10085 1.90041 3.5 2.22198 3.5 2.7611Z"></path></svg><span data-processed="true">57s</span></div><div class="s3ITrd" data-processed="true" style="background: none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255); opacity: 0.85; display: flex; height: 3.99375px; justify-content: center; position: absolute; z-index: 1; left: 145.912px; width: 36.4688px;"><div class="PoLW7d" data-processed="true" style="position: absolute; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; border-top: 2.4px solid rgb(255, 255, 255); top: -7px;">  
</div></div></div><div class="dumoDb YkW4Kb" data-processed="true" style="z-index: 2; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.6); border-radius: 100px; cursor: pointer; position: absolute; right: 14px; top: 12px;"><div class="CaQWce" data-processed="true" jscontroller="sRLmTc" jsuid="Rb9aF_2i" style="align-items: center; color: rgb(255, 255, 255); display: flex; height: 20px; justify-content: center; transform: rotate(45deg); width: 20px;"><svg fill="currentColor" height="18px" viewbox="0 -960 960 960" width="18px" xmlns="http://www.w3.org/2000/svg"><path d="M480-120 300-300l58-58 122 122 122-122 58 58-180 180ZM358-598l-58-58 180-180 180 180-58 58-122-122-122 122Z" fill="currentColor"></path></svg></div></div><div class="AJ10sd" data-processed="true" data-signal-inputs="RMdumc=Rb9aF_2c/TVP8Qe" data-ved="2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQz_MQegQIBRAE" data-wiz-uids="Rb9aF_2j,Rb9aF_2k" jsaction="rcuQ6b:&Rb9aF_2j|npT2md" jscontroller="oi1tWc" jsuid="Rb9aF_2j" style="position: absolute; inset: 0px; z-index: 1;"><video class="OjJwgf" data-processed="true" loop="loop" muted="" preload="none" src="https://encrypted-vtbn1.gstatic.com/video?q=tbn:ANd9GcQABv_lLW-A9R0P-IAhP6xmJ5hES43szH4SokvKUpPmf_YkgpZc" style="width: 631.987px; height: 353.906px; object-fit: cover; opacity: 0; transition: opacity 0.2s ease-in-out;"></video></div></div></div></div><div data-processed="true">[<div class="RhEuY" data-processed="true" style="display: flex; padding: 16px 12px 12px; gap: 8px; align-items: center;"><div class="SWvopd" data-processed="true" jscontroller="aNJZAb" jsuid="Rb9aF_2l" style="height: fit-content; width: fit-content; margin-bottom: 2px; position: relative;"><div class="Lki2rc" data-processed="true" style="width: 20px; height: 20px; line-height: 20px;"><div aria-hidden="true" class="U9BD8 Wsaimf QyEYne" data-processed="true" jscontroller="Cky8Oc" jsuid="Rb9aF_2m" style="width: 19.9875px; height: 19.9875px; line-height: 16px; display: flex; flex-shrink: 0; align-items: center; justify-content: center; overflow: hidden; background-color: rgb(255, 255, 255); border-radius: 50%;"></div></div><div class="JccCTc xG6cCf" data-processed="true" style="position: absolute; bottom: -4px; right: -4px; border-radius: 50%; line-height: 10px; padding: 2px; background-color: rgb(255, 255, 255); width: 10px; height: 10px;"><div aria-hidden="true" class="U9BD8 Wsaimf QyEYne" data-processed="true" jscontroller="Cky8Oc" jsuid="Rb9aF_2n" style="width: 9.99375px; height: 9.99375px; line-height: 16px; display: flex; flex-shrink: 0; align-items: center; justify-content: center; overflow: hidden; background-color: rgb(255, 255, 255); border-radius: 50%;"></div></div></div><div data-processed="true"><div class="SrjfCd" data-processed="true" style="color: rgb(31, 31, 31); font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">Dave Hollingworth</div><div class="Pcl3Vd" data-processed="true" style="color: rgb(31, 31, 31); letter-spacing: 0px; font-size: 11px; line-height: 13px;">YouTube • 2 May 2024</div></div></div>](https://www.youtube.com/watch?v=1eH43qVMCOU&t=229)</div></div></div></div></div></div><div class="Fsg96" data-processed="true" data-sfc-cp="" jsaction="rcuQ6b:&Rb9aF_2o|npT2md" jscontroller="KHhJQ" jsuid="Rb9aF_2o">  
</div><div aria-level="3" class="otQkpb" data-animation-nesting="" data-processed="true" data-sfc-cp="" jscontroller="a7qCn" jsuid="Rb9aF_2p" role="heading" style="color: rgb(0, 29, 53); font-family: 'Google Sans', Roboto, Arial, sans-serif; font-size: 20px; line-height: 28px; margin: 20px 0px 10px; font-weight: 600;">Key Files &amp; Folders:<span class="txxDge notranslate" data-processed="true" data-wiz-uids="Rb9aF_2q,Rb9aF_2r,Rb9aF_2s" style="visibility: hidden;"><span class="vKEkVd" data-animation-atomic="" data-processed="true" style="white-space: nowrap; position: relative;"><button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="0d3880ff-a21c-4da6-ad10-ccbf4dfdf57d" data-processed="true" data-ved="2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQye0OegQIBhAA" data-wiz-attrbind="disabled=Rb9aF_2q/C5gNJc;class=Rb9aF_2q/UpSNec;" style="margin: 0px 6px 0px 0px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div>- <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">`composer.json`: Your project's manifest, listing dependencies and versions.</span>
- <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">`composer.lock`: Locks exact package versions to ensure consistent installations across environments.</span>
- <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">`vendor/`: Directory where Composer installs all downloaded packages and the autoloader.</span><span class="uJ19be notranslate" data-processed="true" data-wiz-uids="Rb9aF_33,Rb9aF_34,Rb9aF_35"><span class="vKEkVd" data-animation-atomic="" data-processed="true" style="white-space: nowrap; position: relative;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="5864ee92-4fd4-4ff7-a037-7a172b7346f1" data-processed="true" data-ved="2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQye0OegQIBxAD" data-wiz-attrbind="disabled=Rb9aF_33/C5gNJc;class=Rb9aF_33/UpSNec;" style="margin: 0px 6px 0px 0px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span>

<div class="Y3BBE" data-hveid="CAgQAA" data-processed="true" data-sfc-cp="" jsaction="rcuQ6b:&Rb9aF_39|npT2md" jscontroller="zcfIf" jsuid="Rb9aF_39" style="font-family: 'Google Sans', Roboto, Arial, sans-serif; font-size: 16px; line-height: 24px; overflow-wrap: break-word; margin: 10px 0px 20px; color: rgb(10, 10, 10);">This video explains the initial setup and use of Composer: <div class="" data-processed="true" data-wiz-uids="Rb9aF_3b,Rb9aF_3c" jscontroller="uDeH3" jsuid="Rb9aF_3a"><div data-hveid="CAgQAQ" data-processed="true" data-ved="2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQ-bUQegQICBAB"><div data-processed="true"><div class="Q2WBBe" data-processed="true" jsuid="Rb9aF_3c" style="container-type: inline-size; display: flex; flex-direction: column; background-color: rgb(243, 245, 246); margin-top: 12px; border-radius: 16px;"><div aria-label="" class="r0hyfc" data-animation-nesting="" data-processed="true" data-ved="2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQypYSegQICBAC" jsuid="Rb9aF_3b" style="overflow: hidden; position: relative; border-radius: 16px 16px 0px 0px; width: 631.987px; height: 353.906px; outline: 0px;" tabindex="-1"><div class="RtAO3b" data-processed="true" data-sfc-cp="" data-wiz-uids="Rb9aF_3e" jsaction="rcuQ6b:&Rb9aF_3d|npT2md" jscallback="gfNXHe:&Rb9aF_3a:U8wGUb" jscontroller="wMmv4c" jsuid="Rb9aF_3d" style="width: 631.987px; height: 353.906px;"><div class="nrdPJf" data-processed="true" data-ved="2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQtbEQegQICBAD" jsaction="click:&Rb9aF_3d|T2P31d" jsuid="Rb9aF_3e" role="button" style="cursor: pointer; width: 631.987px; height: 353.906px; outline: 0px;" tabindex="0"><div class="n7j80c YkW4Kb" data-processed="true" jscontroller="ItMuwb" jsuid="Rb9aF_3f" style="z-index: 2; border-radius: 100px; bottom: 12px; height: 4px; left: 12px; position: absolute; width: calc(100% - 24px); --segment-bar-offset: 12px;"><div class="llCCib" data-processed="true" style="transform: translateX(-50%); width: fit-content; align-items: center; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255); opacity: 0.85; border-radius: 100px; color: rgb(31, 31, 31); display: flex; flex-direction: row; font-size: 12px; gap: 4px; line-height: 1.33; padding: 2px 8px; position: absolute; top: -27px; white-space: nowrap; left: 203.662px;"><svg fill="currentColor" height="12" viewbox="0 0 12 12" width="12" xmlns="http://www.w3.org/2000/svg"><path d="M3.5 2.7611V9.2386C3.5 9.77772 4.10085 10.0993 4.54942 9.80023L9.40755 6.56148C9.80832 6.2943 9.80832 5.70539 9.40755 5.43821L4.54942 2.19946C4.10085 1.90041 3.5 2.22198 3.5 2.7611Z"></path></svg><span data-processed="true">1m</span></div><div class="s3ITrd" data-processed="true" style="background: none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255); opacity: 0.85; display: flex; height: 3.99375px; justify-content: center; position: absolute; z-index: 1; left: 182.381px; width: 42.5437px;"><div class="PoLW7d" data-processed="true" style="position: absolute; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; border-top: 2.4px solid rgb(255, 255, 255); top: -7px;">  
</div></div></div><div class="dumoDb YkW4Kb" data-processed="true" style="z-index: 2; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.6); border-radius: 100px; cursor: pointer; position: absolute; right: 14px; top: 12px;"><div class="CaQWce" data-processed="true" jscontroller="sRLmTc" jsuid="Rb9aF_3g" style="align-items: center; color: rgb(255, 255, 255); display: flex; height: 20px; justify-content: center; transform: rotate(45deg); width: 20px;"><svg fill="currentColor" height="18px" viewbox="0 -960 960 960" width="18px" xmlns="http://www.w3.org/2000/svg"><path d="M480-120 300-300l58-58 122 122 122-122 58 58-180 180ZM358-598l-58-58 180-180 180 180-58 58-122-122-122 122Z" fill="currentColor"></path></svg></div></div></div></div></div><div data-processed="true">[<div class="RhEuY" data-processed="true" style="display: flex; padding: 16px 12px 12px; gap: 8px; align-items: center;"><div class="SWvopd" data-processed="true" jscontroller="aNJZAb" jsuid="Rb9aF_3h" style="height: fit-content; width: fit-content; margin-bottom: 2px; position: relative;"><div class="Lki2rc" data-processed="true" style="width: 20px; height: 20px; line-height: 20px;"><div aria-hidden="true" class="U9BD8 Wsaimf QyEYne" data-processed="true" jscontroller="Cky8Oc" jsuid="Rb9aF_3i" style="width: 19.9875px; height: 19.9875px; line-height: 16px; display: flex; flex-shrink: 0; align-items: center; justify-content: center; overflow: hidden; background-color: rgb(255, 255, 255); border-radius: 50%;"></div></div><div class="JccCTc xG6cCf" data-processed="true" style="position: absolute; bottom: -4px; right: -4px; border-radius: 50%; line-height: 10px; padding: 2px; background-color: rgb(255, 255, 255); width: 10px; height: 10px;"><div aria-hidden="true" class="U9BD8 Wsaimf QyEYne" data-processed="true" jscontroller="Cky8Oc" jsuid="Rb9aF_3j" style="width: 9.99375px; height: 9.99375px; line-height: 16px; display: flex; flex-shrink: 0; align-items: center; justify-content: center; overflow: hidden; background-color: rgb(255, 255, 255); border-radius: 50%;"></div></div></div><div data-processed="true"><div class="SrjfCd" data-processed="true" style="color: rgb(31, 31, 31); font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">Laracasts</div><div class="Pcl3Vd" data-processed="true" style="color: rgb(31, 31, 31); letter-spacing: 0px; font-size: 11px; line-height: 13px;">YouTube • 1 Nov 2023</div></div></div>](https://www.youtube.com/watch?v=MJH1geEYMRI&t=234)</div></div></div></div></div></div><div class="Fsg96" data-processed="true" data-sfc-cp="" jsaction="rcuQ6b:&Rb9aF_3k|npT2md" jscontroller="KHhJQ" jsuid="Rb9aF_3k">  
</div><div aria-level="3" class="otQkpb" data-animation-nesting="" data-processed="true" data-sfc-cp="" jscontroller="a7qCn" jsuid="Rb9aF_3l" role="heading" style="color: rgb(0, 29, 53); font-family: 'Google Sans', Roboto, Arial, sans-serif; font-size: 20px; line-height: 28px; margin: 20px 0px 10px; font-weight: 600;">Basic Commands:<span class="txxDge notranslate" data-processed="true" data-wiz-uids="Rb9aF_3m,Rb9aF_3n,Rb9aF_3o" style="visibility: hidden;"><span class="vKEkVd" data-animation-atomic="" data-processed="true" style="white-space: nowrap; position: relative;"><button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="12e2697a-7ad3-4df3-8b2f-c6eeef99ac20" data-processed="true" data-ved="2ahUKEwjpvsDj7rSRAxXRzqACHeEfPAEQye0OegQICRAA" data-wiz-attrbind="disabled=Rb9aF_3m/C5gNJc;class=Rb9aF_3m/UpSNec;" style="margin: 0px 6px 0px 0px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div>- <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">`composer install`: Installs dependencies from `composer.json` / `composer.lock`.</span>
- <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">`composer require vendor/package`: Adds and installs a new package.</span>
- <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">`composer update`: Updates packages to newer compatible versions.</span>
- <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">`composer dump-autoload`: Regenerates the autoloader.</span><span class="uJ19be notranslate" data-processed="true" data-wiz-uids="Rb9aF_6e,Rb9aF_6f,Rb9aF_6g"><span class="vKEkVd" data-animation-atomic="" data-processed="true" style="white-space: nowrap; position: relative;"> </span></span>

</div></div></div></div></div></div></div></div></section></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>

# How to switch in different composer version in ubuntu

<span data-huuid="7953665654382654826">To switch between different Composer versions on Ubuntu, particularly between major versions like Composer 1 and Composer 2, you can use the `self-update` command with specific flags.  
</span>

<div class="WaaZC" id="bkmrk-switching-between-co"><div class="RJPOee EIJn2" style="animation: none !important;"><div class="rPeykc pyPiTc" data-hveid="CAsQAQ" data-ved="2ahUKEwiIysPym8qQAxX3UGwGHc_RO24Qo_EKegQICxAB">**<span data-huuid="7953665654382655248">Switching between Composer 1 and Composer 2:   
  
</span>**</div></div></div><div class="WaaZC" id="bkmrk-to-switch-to-compose"><div class="RJPOee EIJn2" style="animation: none !important;"><div class="rPeykc" data-hveid="CAkQAQ" data-ved="2ahUKEwiIysPym8qQAxX3UGwGHc_RO24Qo_EKegQICRAB"><span data-huuid="17506161521791167044">To switch to Composer 1. </span></div></div></div><div class="WaaZC" id="bkmrk-"><div class="RJPOee EIJn2" style="animation: none !important;"><div jsaction="rcuQ6b:npT2md" jscontroller="JegcYe"><div class="ecCNFc"><div class="zYSUYd"><div class="FS7GEb">  
</div></div></div></div></div></div>```
    composer self-update --1
```

<div class="WaaZC" id="bkmrk--1"><div class="RJPOee EIJn2" style="animation: none !important;">  
</div></div><div class="WaaZC" id="bkmrk-to-switch-to-compose-1"><div class="RJPOee EIJn2" style="animation: none !important;"><div class="rPeykc" data-hveid="CAcQAQ" data-ved="2ahUKEwiIysPym8qQAxX3UGwGHc_RO24Qo_EKegQIBxAB"><span data-huuid="17506161521791164726">To switch to Composer 2. </span></div></div></div><div class="WaaZC" id="bkmrk--2"><div class="RJPOee EIJn2" style="animation: none !important;"><div jsaction="rcuQ6b:npT2md" jscontroller="JegcYe"><div class="ecCNFc"><div class="zYSUYd"><div class="FS7GEb"><div class="dDrxod">  
</div></div></div></div></div></div></div>```
    composer self-update --2
```

<div class="WaaZC" id="bkmrk-other-useful-self-up"><div class="RJPOee EIJn2" style="animation: none !important;"><div class="rPeykc pyPiTc" data-hveid="CBQQAQ" data-ved="2ahUKEwiIysPym8qQAxX3UGwGHc_RO24Qo_EKegQIFBAB"><span data-huuid="10643308391183684185">Other useful `self-update` commands: </span></div></div></div><div class="WaaZC" id="bkmrk-to-update-to-the-lat"><div class="RJPOee EIJn2" style="animation: none !important;">- <span data-huuid="10643308391183684512">**To update to the latest stable version (usually Composer 2):** </span>

</div></div><div class="WaaZC" id="bkmrk--3"><div class="RJPOee EIJn2" style="animation: none !important;"><div jsaction="rcuQ6b:npT2md" jscontroller="JegcYe"><div class="ecCNFc"><div class="zYSUYd"><div class="FS7GEb"><div class="dDrxod">  
</div></div></div></div></div></div></div>```
    composer self-update
```

<div class="WaaZC" id="bkmrk-to-revert-to-the-pre"><div class="RJPOee EIJn2" style="animation: none !important;">- <span data-huuid="15961951688269689046">**To revert to the previous Composer version:** </span>

</div></div><div class="WaaZC" id="bkmrk--4"><div class="RJPOee EIJn2" style="animation: none !important;"><div jsaction="rcuQ6b:npT2md" jscontroller="JegcYe"><div class="ecCNFc"><div class="zYSUYd"><div class="FS7GEb"><div class="dDrxod">  
</div></div></div></div></div></div></div>```
    composer self-update --rollback
```

<div class="WaaZC" id="bkmrk-to-preview-a-new-com"><div class="RJPOee EIJn2" style="animation: none !important;">- <span data-huuid="18426634376716338086">**To preview a new Composer version before updating:** </span>

</div></div><div class="WaaZC" id="bkmrk--5"><div class="RJPOee EIJn2" style="animation: none !important;"><div jsaction="rcuQ6b:npT2md" jscontroller="JegcYe"><div class="ecCNFc"><div class="zYSUYd"><div class="FS7GEb">  
</div></div></div></div></div></div>```
    composer self-update --preview
```

<div class="WaaZC" id="bkmrk-important-notes%3A"><div class="RJPOee EIJn2" style="animation: none !important;"><div class="rPeykc pyPiTc" data-hveid="CCoQAQ" data-ved="2ahUKEwiIysPym8qQAxX3UGwGHc_RO24Qo_EKegQIKhAB"><span data-huuid="12731431222685702112">Important Notes: </span></div></div></div><div class="WaaZC" id="bkmrk-if-you-encounter-per"><div class="RJPOee EIJn2" style="animation: none !important;">- <span data-huuid="12731431222685704143">If you encounter permission errors when running `composer self-update`, you might need to run it with `sudo`, like `sudo composer self-update --2`. </span><span data-huuid="12731431222685700724">However, be cautious when using `sudo` with Composer, as it can sometimes lead to permission issues in your user's home directory. </span>
- <span data-huuid="12731431222685702078">Ensure your PHP environment is compatible with the Composer version you are switching to. </span><span data-huuid="12731431222685702755">Different Composer versions might have different PHP version requirements. </span>
- <span data-huuid="12731431222685704109">After switching versions, you can verify the current Composer version by running: </span>

</div></div><div class="WaaZC" id="bkmrk--6"><div class="RJPOee EIJn2" style="animation: none !important;"><div jsaction="rcuQ6b:npT2md" jscontroller="JegcYe"><div class="ecCNFc"><div class="zYSUYd"><div class="FS7GEb"><div class="dDrxod"><div aria-live="polite" class="WDoJJe">  
</div></div></div></div></div></div></div></div>```
    composer --version
```