예제 #1
0
 /**
  * @covers FireflyIII\Repositories\Category\CategoryRepository::destroy
  */
 public function testDestroy()
 {
     $category = FactoryMuffin::create('FireflyIII\\Models\\Category');
     $this->object->destroy($category);
     $count = Category::where('id', $category->id)->whereNull('deleted_at')->count();
     $this->assertEquals(0, $count);
 }
예제 #2
0
        }
    }
    throw new NotFoundHttpException();
});
Route::bind('piggyBank', function ($value) {
    if (Auth::check()) {
        $object = PiggyBank::where('piggy_banks.id', $value)->leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id')->where('accounts.user_id', Auth::user()->id)->first(['piggy_banks.*']);
        if ($object) {
            return $object;
        }
    }
    throw new NotFoundHttpException();
});
Route::bind('category', function ($value) {
    if (Auth::check()) {
        $object = Category::where('id', $value)->where('user_id', Auth::user()->id)->first();
        if ($object) {
            return $object;
        }
    }
    throw new NotFoundHttpException();
});
Route::bind('tag', function ($value) {
    if (Auth::check()) {
        $object = Tag::where('id', $value)->where('user_id', Auth::user()->id)->first();
        if ($object) {
            return $object;
        }
    }
    throw new NotFoundHttpException();
});