Laravel Basic #2

MySQL DB make Table

use Illuminate\Support\Facades\DB;

  1. getData from DB

Within Function

{

$data = DB::table(‘table_name’)-> getData();

}

2. make a table

Command

php artisan make:migration create_AAAAAs

Set your Column

public function up()
{
Schema::create('AAAAAs', function (Blueprint $table) {
$table->id();
$table->string('title') ;
$table->string('content');
$table->integer('price');
$table->timestamps();
});
}

And Command

php artisan migrate

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mario tsai

Major in physical education. Football referee. And high interest in looking the world through the numbers.