tinkerとmysql

【tinker】
./vendor/bin/sail tinker
パターン①
$post = new App\Models\Post();
$post->title = '○○';
$post->body = '○○';
$post->save();
exit;

パターン②
App\Models\Post::create(['title'=>'○○','body'=>'○○']);
App\Models\Post::all();
App\Models\Post::find(3);
App\Models\Post::findOrFail(3);
App\Models\Post::orderBy('created_at', 'desc')->limit(3)->get();
App\Models\Post::latest()->get();

$post3 = App\Models\Post::find(3);
$post3->title('○○');
$post3->save();

$post3 = App\Models\Post::find(3);
$post3->delete();

 

mysql
./vendor/bin/sail mysql mybbs
SHOW TABLES;
SELECT * FROM posts;
DESC posts;
exit;