switchon@lavalamp.biz
+27(0) 83 419 4851 / +27(0) 21 036 1165
Application & software development
Get A Quote

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact
    cascading style sheets
    What’s The Deal With CSS4?
    Nov 30, 2020
    how to implement a cropper tools in your frontend vue application
    How To Implement A Cropper Tool In Your Frontend Vue Application
    Jan 11, 2021

    Laravel Migrations VS CodeIgniter Migrations

    Categories
    • Web Development
    Tags
    • codeigniter
    • database
    • framework
    • frameworks
    • laravel
    • migration
    • PHP
    • table
    laravel migrations vs codeIgniter migrations
    laravel migrations vs codeIgniter migrations

    Laravel and CodeIgniter are both PHP frameworks. They have many differences but they also have their similarities. One of their similarities is that they both have migrations but I will be showing you the differences between their migrations.

    Migration: A migration is a single PHP file that describes the changes to operate to the database. A migration file can create or drop tables, add or remove columns, create indexes and even insert data into your database.


    The Setup:


    Laravel:

    1. Type the below into your command line:
      php artisan make:migration migrationName

      • The naming conventions I use for the migrationName
      • If I am creating a table: createUsersTable
      • If I am altering a table: alterUsersTableAddContact - I usually specify what I am altering incase I need to alter the table again in the future then it is easy to keep track of changes.

    CodeIgniter:

    1. Open application/config/migration.php and check that $config['migration_enabled'] is set to true.
    2. In application/config/ create a folder called migrations
    3. In the migrations folder is where you can create your migrations
      • Naming conventions to use for the migration file name: YYYYMMDDHHIISS_create_users
        • where:
          • YYYYMMDDHHIISS is the time stamp of when you are creating the file
          • create_users is what the migration does (eg. creates a users table)
    4. In the migration file you created add the below code:


    Creating a Migration


    Laravel:

    1. Locate the migration file that was created (database/migrations/)
      • If you are creating a table:
      • If you are altering a table:

    CodeIgniter:

    1. Edit your migration file you created
      • If you are creating a table:
      • If you are altering a table:


    Running Migrations


    Laravel:

    1. Type the below into your command line
      • php artisan migrate
        • migrate:fresh  will drop all the tables you currently have in your DB and migrate all migrations from scratch
        • migrate:rollback will rollback your DB to the state it was before you did your last migration

    CodeIgniter:

    1. To run the migrations you have created you will need to create a controller called migrate
    2. In your migrate controller add the code below:
    3. To run the migrations go to http://yoursite.com/migrate  


    Conclusion


    Laravel and CodeIgniter are very similar in their processes but I find Laravel's migrations a lot easier and faster to implement.


    Happy Coding!

    Contact us


      Related posts:

      laravel livewireLaravel Livewire laravel envoyer and forgeProvisioning A New Digital Ocean Server With Laravel Forge, And Deploying Code With Laravel Envoyer how to create and digitally sign a pdf using laravel and tcpdfHow To Create And Digitally Sign A PDF Using Laravel And TCPDF laravel observersLaravel Observers
      Share
      18
      Rayne Logan
      Rayne Logan
      Rayne is a web developer with experience in PHP web apps and has an interest in project management and mobile development.

      Leave a Reply Cancel reply

      Your email address will not be published. Required fields are marked *

      Lava Lamp Lab


      Like technology, a lava lamp constantly changes form, producing new conditions with every passing moment



      lava lamp lab facebook   lava lamp lab twitter   lava lamp lab linkedin   lava lamp lab instgram

      Services


      Application & software development

      Outsourced software development

      Project based resourcing

      Digital marketing & consulting

      Graphic design & consulting

      UI / UX design & consulting

      Contact Us


      +27(0) 83 419 4851

      +27(0) 21 036 1165


      switchon@lavalamp.biz


      Unit 4 Monaco Square,
      14 Church Street,
      Durbanville,
      Cape Town, 7550

      NBConsult Group


      nbconsult
      nbconnect msp
      nbclearning
      river broadband
      designer needed
      © 2023 Lava Lamp Lab (Pty) Ltd | All Rights Reserved | Privacy Policy
      Contact us now

        Application & software development

          Outsourced software development

            Project based resourcing

              Digital marketing & consulting

                Graphic design & consulting

                  UI/UX design & consulting

                    Lease an expert

                      Recruitment services

                        We are using cookies to give you the best experience on our website.

                        You can find out more about which cookies we are using or switch them off in settings.

                        Lava Lamp Lab
                        Powered by  GDPR Cookie Compliance
                        Privacy Overview

                        This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

                        Strictly Necessary Cookies

                        Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

                        If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.

                        3rd Party Cookies

                        This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.

                        Keeping this cookie enabled helps us to improve our website.

                        Please enable Strictly Necessary Cookies first so that we can save your preferences!

                        Cookie Policy

                        More information about our Cookie Policy