Laravel API step by step (draft)

  1. Prerequisite
    1. Install XAMP
    2. Install Composer
  2. Installation
    1. Run gitbash
      1. composer create-project –prefer-dist laravel/laravel [projectname]
    2. For existing code and want to install the dependencies, just use the below command
      1. composer install
    3. Edit host domain
    4. Setup database
      1. Create database via phpmyadmin
        1. localhost/phpmyadmin
      2. create migration script from terminals
        1. php artisan make:migration create_articles_table –create=articles
      3. Create seeder
        1. php artisan make:seeder ArticlesSeeder
      4. Create factory
        1. php artisan make:factory ArticleFactory
      5. Create model
        1. php artisan make:model Article
      6. Run the migration
        1. php artisan migrate
        2. php artisan db:seed
    5. Install passport package for authentication module
      1. php artisan passport:install
      2. https://laravel.com/docs/5.8/passport#installation
    6. Run the application
      1. php artisan serve
  3. Install Database in centos
    1. yum install mysql -> this command will install mariadb
    2. yum list installed | grep mariadb -> check the condition
    3. yum install mairadb-server -> install maria  db servre
    4. systemctl start mariadb -> to start service
    5. Reference
      1. https://stackoverflow.com/questions/31067135/in-centos7-can-not-start-mysql
    6. Test database using putty
      1. [server]$ mysql -h <DBhostname> -u <DBuser> -p <DBname>
      2. show tables
  4. References
    1. https://www.youtube.com/watch?v=4pc6cgisbKE
    2. https://www.youtube.com/watch?v=GRhkhSzyApc&list=PLEhEHUEU3x5q-xB1On4CsLPts0-rZ9oos&index=10