. Hello, world!

REST API Startup Environment

install a fresh laravel project

composer create-project laravel/laravel fresh_project

install breeze

composer require laravel/breeze --dev
php artisan breeze:install api

api just add a library in user model we will add it manually later as well

add in model 

use laravel\Sanctum\HasApiTokens;

and

 use HasFactory, Notifiable,HasApiTokens;

now make a article model

php artisan make:model Article -m

now in Article migration

$table->string('title');
           $table->string('slug');
           $table->longText('body');
           $table->foreignId('author_id')->constrained('users')->cascadeOnDelete();

now in article model

 use HasFactory;
   const Table='articles';
   protected $table=self::Table;
   // protected $table='articles'; //You can also se this single line instead of upper two classes
   protected $fillable=[
       'title',
       'slug',
       'body',
       'author_id',
   ];
   //Below code is optional
   public function id():string{
       return(string) $this->id;
   }