Skip to content

Instantly share code, notes, and snippets.

/**
* Laravel US migration and seed.
*/
# command to create migration file
php artisan make:migration create_states_table
# migration file
<?php
use Illuminate\Database\Schema\Blueprint;
Q: Where are you online?
A: I am in diffferent places.
- https://sherwinm.com
- Youtube: https://www.youtube.com/channel/UCxxfYRicpclvAjAveEgraYw
- Twitter: https://twitter.com/w1n78 or @w1n78
- Instagram: https://www.instagram.com/w1n78
Q: What OS are you using?
A: Windows 10, MacOS Catalina, Ubuntu Desktop 19.10
@sherwinmartin
sherwinmartin / gist:84cec8e1a795467cffddbb49bfa081e1
Last active November 3, 2020 04:47
sample database for help
CREATE SCHEMA `mydb`;
USE `mydb`;
/**
* Student records
*/
CREATE TABLE `students` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`name` VARCHAR(100) NOT NULL
@sherwinmartin
sherwinmartin / gist:19540edb12f7325eb94c987ebe4d3d40
Created May 3, 2021 23:03
add mysql and phpmyadmin to sail docker file
mysql:
platform: linux/x86_64
image: 'mysql:8.0'
ports:
- '${FORWARD_DB_PORT:-3306}:3306'
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
MYSQL_DATABASE: '${DB_DATABASE}'
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'