Laravel Model Factory Tutorial using Artisan make:model 103

Поделиться
HTML-код
  • Опубликовано: 23 июл 2024
  • Laravel Model Factory Tutorial using Artisan make:model 103. (see shortcuts below to key points) Adam Culp of Beachcasts php programming videos shares how to use Laravel Artisan make:model to create a model, seeder, and also use Tinker.
    Please * LIKE, COMMENT, AND SUBSCRIBE * - and share with others!
    Key Topics:
    - Creating a Model
    - Using Artisan
    - Creating a database Seeder
    - Using Tinker
    For a nice list of equipment I use in my studio, and to support the channel if you make any purchases (doesn't cost you a thing), visit my kit at kit.co: kit.co/beachcasts/beachcasts-...
    Errata:
    Let me know if you notice anything that should be errata
    Associated Links:
    beachcasts.com
    laravel.com
    Timeline:
    00:00 Video Intro
    01:21 Execute bash shell within Docker Container
    01:53 Drop the old database table using PhpStorm database panel
    02:25 Create a new database migration using Artisan
    03:50 Edit the database migration to desired schema
    07:03 Run new database migration using Artisan
    08:28 Create a new Model Factory using Artisan
    09:37 Add data generation criteria to create using Faker in the new Model Factory
    10:53 Create a new Seeder using Artisan
    12:05 Edit Seeder with how to use the Model.
    13:08 Update the DatabaseSeeder with the new Seeder
    13:45 Run the Seeder using Migrate through Artisan
    14:22 Check database for newly created seed data
    14:48 Using Tinker through Artisan to query data via CLI
    15:15 Using first() to query the first record using Tinker
    15:26 Using all() to query all records using Tinker
    Other Beachcasts videos you might find interesting:
    Authentication in Laravel Tutorial • Authentication in Lara...
    Top 5 skills to be a better software developer • Top 5 skills to be a b...
    Install Laravel in Docker container on Ubuntu for beginners • Install Laravel in Doc...
    Getters and Setters accessors in object oriented programming • Getters and Setters ac...
    Critical programming issues preventing a PHP 7 upgrade • Critical programming i...
    Behat for beginners functional REST API testing tutorial • Behat for beginners fu...
    Doctrine ORM one-to-many bi-directional association • Doctrine ORM one-to-ma...
    PHP Mess Detector static analysis to find PHP code smells • PHP Mess Detector stat...
    Doctrine ORM one-to-many self-referencing association • PHP DoctrineORM one-to...
    10 reasons to become a consultant in a consulting business • Top 10 Reasons To Be a...
    Zend Framework becomes Laminas project at Linux Foundation • Zend Framework becomes...
    10 bad things about consulting • Top 10 bad things abou...
    How to get lines of code in PHP • PHPLoc Lines of code s...
    Make a List handler middleware • List handler middlewar...
    Make a Delete handler middleware • Delete handler middlew...
    Make an Update handler middleware • Update handler middlew...
    Use UUID with Doctrine ORM for DB keys • UUID with Doctrine ORM...
    Make a Create handler middlware • Create Handler middlew...
    Automate Hypermedia creation for PHP REST API • Automate Hypermedia PH...
    Learn about Hypermedia and how to create it • Creating Hypermedia (H...
    Doctrine ORM Paginator for PHP REST API • Doctrine ORM Paginator...
    Doctrine ORM Entity how to • Create Doctrine ORM En...
    Configure Doctrine ORM • Configure Doctrine ORM...
    Create PHP middlware with Zend Expressive • Create PHP middleware ...
    Configure PhpStorm for PHP development with Docker • PhpStorm setup for PHP...
    Create PHP development environment with docker • PHP web development en...
    Help through referrals:
    Thinking of buying a Tesla electric vehicle? Use this referral link to also get six months of free Supercharging for both of us. Thank you. www.tesla.com/referral/tanya2...
    I use TubeBuddy to help me manage my RUclips channel. If you're interested, click the following link to check it out. www.tubebuddy.com/beachcasts
    #php #webdevelopment #beachcasts
  • НаукаНаука

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

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

    After this video check out others in my Laravel series: ruclips.net/p/PL6_nF0awZMoNUHazztOt4DRH0VIEIFXXO

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

      Also, check out the Expressive REST API playlist: ruclips.net/p/PL6_nF0awZMoMol4RPLf99WIZuoJ3l87oG

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

    Really excellent video tutorial.

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

      Glad you found it helpful.

  • @amirbahador.developer
    @amirbahador.developer 4 года назад

    Good job.ty🙏🏻♥️🌷

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

    First, great tutorials. i got really excited when i saw that you will be doing a series on laravel. just wondering, when the next video will be out. Keep up the great work.

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

      Thank you. I hope to include more eventually. I may update the existing app to version 6 in the next video of that thread, then continue from there.

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

      @@Beachcasts just wondering when you will continue with this tutorial

  • @MuhammadAdnan-gx6rd
    @MuhammadAdnan-gx6rd 5 лет назад

    How to implement this relationship 1 user can enroll in only 2 courses how to please?

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

      Adding relationships is planned for a future, but for now here is a link that may help you. laravel.com/docs/5.8/eloquent-relationships#one-to-many

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

    I think you should use `$table->boolean('column_name')->default(False);` for boolean columns

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

      Oh, that's nice. Thanks. I'll give that a try.

  • @inteteam-webdevelpment8246
    @inteteam-webdevelpment8246 2 года назад

    Why this channel died on the Laravel topic? :)

    • @Beachcasts
      @Beachcasts  2 года назад +1

      It was just a pause. It will be back. ;-)

    • @inteteam-webdevelpment8246
      @inteteam-webdevelpment8246 2 года назад

      @@Beachcasts Thank you. But, I'm here on Kubuntu 20.04 and was following your Docker video, will comment on that now :). Doesn't work here.

    • @Beachcasts
      @Beachcasts  2 года назад

      @@inteteam-webdevelpment8246 Thank you. Both Laravel, and the version of PHP have changed since this video was posted. I recommend following the Laravel documentation, which is what I did for this video.

    • @inteteam-webdevelpment8246
      @inteteam-webdevelpment8246 2 года назад

      @@Beachcasts yes, that's where I've started and where I fail. Had to move on to Docker cause Sail in the Laravel doesn't work ;) with my OS.