• phpfour Profile Picture

    Mohammad Emran ⚡️ @phpfour

    a year ago

    Laravel Tip ⚡ Ever heard of the "Tell, Don't Ask" principle? It states that we should not fetch data from an object to do conditional checks upon it, instead, we should ask the object to do that for us. Added benefits: clear intention, reusable logic & less error-prone code.

    phpfour tweet picture

    9 23 166 16K 64
    Download Image
  • nik0phil Profile Picture

    nikophil @nik0phil

    a year ago

    @phpfour This is called encapsulation, and is a pillar of OOP 🙂

    0 0 5 149 0
  • al_imran_ahmed Profile Picture

    Al Imran Ahmed @al_imran_ahmed

    a year ago

    @phpfour It’s a great approach in general. But one problem with this specific example is, the model continues growing with time. At one point thar model can become unmaintanable. How do you approach solving that issue?

    2 0 4 409 0
  • _newtonjob Profile Picture

    Newton Job @_newtonjob

    a year ago

    @phpfour The absolute best way. My method name OCD will want it to read as close to English to possible :) if ($lesson->contentIsUnlocked())

    1 0 4 373 0
  • MrPunyapal Profile Picture

    Punyapal Shah @MrPunyapal

    a year ago

    @phpfour I love this way 😍

    0 0 3 408 0
  • PerttiSoomann Profile Picture

    Pert Soomann @PerttiSoomann

    a year ago

    @phpfour Good advice, one of my favourite "self documenting code" techniques 🤓

    0 0 3 249 0
  • techygist Profile Picture

    Azhar Uddin @techygist

    a year ago

    @phpfour I always thought this was more common in large project for maintainability.

    0 0 2 346 0
  • nicksdot Profile Picture

    Nick e/code @nicksdot

    a year ago

    @phpfour Good one. 💅

    0 0 1 280 0
  • dangnam_me Profile Picture

    Nam Nguyen @dangnam_me

    a year ago

    @phpfour Yes, it's concept of domain driven.

    0 0 1 64 0
  • raziuldev Profile Picture

    Raziul Islam ☄️ @raziuldev

    a year ago

    @phpfour This is the way to do it 😊

    0 0 1 215 0
  • Download Image
    • Privacy
    • Term and Conditions
    • About
    • Contact Us
    • TwStalker is not affiliated with X™. All Rights Reserved. 2024 www.instalker.org

    twitter web viewer x profile viewer bayigram.com instagram takipçi satın al instagram takipçi hilesi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al sosyalgram takipçi satın al instagram ücretsiz takipçi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al metin2 metin2 wiki metin2 ep metin2 dragon coins metin2 forum metin2 board popigram instagram takipçi satın al takipçi hilesi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al buyfans buy instagram followers buy instagram likes buy instagram views buy tiktok followers buy tiktok likes buy tiktok views buy twitter followers buy telegram members Buy Youtube Subscribers Buy Youtube Views Buy Youtube Likes forstalk postegro web postegro x profile viewer