Laravel Basic #2

Mario tsai
Aug 16, 2021

--

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

--

--

Mario tsai
Mario tsai

Written by Mario tsai

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

No responses yet