Posts

Showing posts from August, 2021

Laravel API

Run api: php artisan serve

Laravel Migrations

1. Run all migration files: php artisan migrate 2. Re run specific migration file: php artisan migrate:refresh --path=database/migrations/2021_07_05_120856_create_users_table.php 3. Drop All Tables & Migrate (drop all tables and recreate): php artisan migrate:fresh php artisan migrate:fresh --seed 4. Create migration file: php artisan make:migration create_tablename_table (replace tablename with table name and keep other keywords as it is php artisan make:migration create_roles_table (this command will create migration file for roles table 5. Delete migration file 1. First delete migration file from migration folder app/database/migrations/my_migration_file_name.php 2. Reset the composer autoload files: composer dump-autoload

Setup php framework cakephp/laravel project from git

Git clone git clone https://github.com/gitname/project.git Install Packages Composer install "composer update is mostly used in the 'development' phase, to upgrade our project packages. composer install is primarily used in the 'deploying phase' to install our application on a production server or on a testing environment, using the same dependencies stored in the composer." Update database and other environment settings Example: key creation, database setup etc

Mysql Commands

Import Db mysql -u root -p db_name

Node Commands

1. Remove node module - rm -rf node_modules/bcrypt 2. Install - "npm install" or "yarn"

Git Commands

Create new git branch from existing branch:  Syntax: git branch <new-branch-name> <existing-branch-name>             Example: git branch newone master

Run Node js and react js

 Node: node start React: npm start