Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eloquent methods in controllers #34

Open
dabernathy89 opened this issue Mar 18, 2014 · 0 comments
Open

Eloquent methods in controllers #34

dabernathy89 opened this issue Mar 18, 2014 · 0 comments

Comments

@dabernathy89
Copy link

Per twitter discussion with @msurguy, these should be extracted into a repository:

UserTricksController lines 150-152:

$trick->tags()->detach();
$trick->categories()->detach();
$trick->delete();

TricksController line 80:

$voted = $trick->votes()->whereUserId($user->id)->first();

TricksController line 84:

$user = $trick->votes()->attach($user->id, [
    'created_at' => new \DateTime,
    'updated_at' => new \DateTime
]);

TricksController line 91:

$trick->votes()->detach($voted->id);

TricksController line 95:

$trick->save();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant