def edit(self, id): article = Article().find(id) if article.user().id == Auth.user().id: return view('articles.edit', article=article) return ErrorResponse('Unauthorised', 500)
def index(self): articles = Article().paginate(size=5) return view('articles.index', articles=articles[0], pagination=articles[1])
def create(self): return view('articles.create')
def show(self, id): return view('articles.show', article=Article().find(id), user=Auth.user())
def login(self): return view('users.login')
def show(self, id): return view('users.show', user=User().find(id))
def register(self): return view('users.register')
def index(self): return view('pages.index')