Skip to content
This repository has been archived by the owner on Aug 20, 2023. It is now read-only.

Commit

Permalink
Updated migration file
Browse files Browse the repository at this point in the history
  • Loading branch information
UnderlineWords committed May 11, 2020
1 parent 0dc3625 commit 6f210e2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
1 change: 1 addition & 0 deletions README_TR.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ $post->hasFavorite(); // $post'un, mevcut kullanıcı için (auth()->user()) fav
$post->addFavorite(); // $post'u, mevcut kullanıcı için (auth()->user()) 'favori' olarak kaydeder
$post->unFavorite(); // $post'un, mevcut kullanıcıya ait (auth()->user()) 'favori' kaydını siler
$post->deleteFavorites(); // $post'a ait tüm favori kayıtlarını siler
$post->favorites()->count(); // $post'u favori olarak kaydeden toplam kullanıcı/kayıt sayısı
```
---
* (Tercihen) UserFavorites trait dosyasını ```User``` model'a ekleyin;
Expand Down
5 changes: 0 additions & 5 deletions migrations/2020_05_06_014641_create_favorites_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ public function up()
$table->unsignedInteger('user_id');
$table->timestamps();

$table->foreign('user_id')
->references('id')
->on('users')
->onDelete('cascade');

$table->unique(['favoriteable_id', 'favoriteable_type', 'user_id']);
});
}
Expand Down

0 comments on commit 6f210e2

Please sign in to comment.