دوستان من توی قسمت 24 لاراول به یه مشکلی برخوردم که ممنون میشم کمکم کنید

این ارور هست

SQLSTATE[23000]: Integrity constraint violation: 19 FOREIGN KEY constraint failed (SQL: insert into "note_tag" ("note_id", "tag_id") values (159, 1), (159, 2))

اینم فایل مدل نوت هست


<?php

namespace App;

use App\User;
use App\Card;
use App\Tag;

use Illuminate\Database\Eloquent\Model;

class Note extends Model
{
    protected $fillable = ['body'];
    public function card()
    {
        return $this->belongsTo(Card::class);
    }

    public function user()
    {
        return $this->belongsTo(User::class);
    }

    public function tags()
    {
        return $this->belongsToMany(Tag::class);
    }
}

اینم مدل کارت

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Card extends Model
{
    public function notes()
    {
        return $this->hasMany(Note::class);
    }
}

اینم مدل تگ

    <?php

    namespace App;

    use App\Note;
    use Illuminate\Database\Eloquent\Model;

    class Tag extends Model
    {
        public function tags()
        {
            return $this->belongsToMany(Note::class);
        }
    }

اینم کنترل نوت

<?php

namespace App\Http\Controllers;

use App\Card;
use App\Note;
use App\Tag;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;

class NotesController extends Controller
{

    public function store(Request $request, Card $card)
    {

        $this->validate($request, [
            'body' => 'required|min:1'
        ]);
        $note = new Note($request->all());
        $note->user_id = 1;

        $card->notes()->save($note);

        $note->tags()->attach($request->input('tags'));

        flash('Your card has been created.');
        return back();
    }
    public function edit(Note $note)
    {
        return view('notes.edit', compact('note'));
        return back();
    }
    public function update(Note $note, Request $request)
    {
        $note->update($request->all());

        return back();
    }
}

این مایگریت تگ

 public function up()
    {
        Schema::create('tags', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->timestamps();
        });

        Schema::create('note_tag', function (Blueprint $table) {
            $table->integer('note_id')->unsigned()->index();
            $table->foreign('note_id')->references('id')->on('notes')->onDelete('cascade')->onUpdate('cascade');
            $table->integer('tag_id')->unsigned()->index();
            $table->foreign('tag_id')->references('id')->on('tags')->onDelete('cascade')->onUpdate('cascade');
        });
    }

ممنون میشم کمکم کنید