예제 #1
0
 public function doNoteDelete($id)
 {
     $note = Notes::findOrFail($id);
     $note->remove();
     return redirect('notes')->with('note_deleted', true);
 }
예제 #2
0
파일: User.php 프로젝트: VoodooPrawn/finest
 public function getNotes()
 {
     $notes = new Collection();
     $note_ids = DB::table('notes')->select('notes.id')->join('notes_user', 'notes_user.notes_id', '=', 'notes.id')->where('notes.author_id', $this->id)->orWhere('notes_user.user_id', $this->id)->get();
     foreach ($note_ids as $id) {
         $notes->push(Notes::findOrFail($id->id));
     }
     return $notes;
 }