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

(Update) Refactor General and Staff Controllers #224

Merged
merged 4 commits into from
Mar 17, 2018

Conversation

HDVinnie
Copy link
Collaborator

  • Remove all facades use besides mail
  • Use Dependency Injection for Illuminate\Http\Request
  • use helpers for auth, cache, validator, and more to rid of facades use
  • use $request->input() over $request->get()
  • use $request->isMethod('POST') over $request->getMethod('POST')
  • general cleanup

- Remove all facades use besides mail
- Use Dependency Injection for Illuminate\Http\Request
- use helpers for auth, cache, validator, and more to rid of facades use
- use $request->input() over $request->get()
- use $request->isMethod('POST') over $request->getMethod('POST')
- general cleanup
@HDVinnie HDVinnie requested a review from a team March 15, 2018 16:36
@HDVinnie
Copy link
Collaborator Author

HDVinnie commented Mar 15, 2018

The faceted function in the TorrentController and RequestController needs to be optimized. Right now its a lot of code and could be crunched down. Maybe something like:

protected function filterTorrentsByRequestParams(Request $request, Torrent $torrent, array $params = [])
    {
        $torrent = $torrent->newQuery();

        foreach ($params as $param) {
            if ($request->has($param) && $request->input($param) != null) {
                $torrent->where($param, $request->input($param));
            }
        }

        return $torrent->get();
    }

Cleaner?

@HDVinnie HDVinnie merged commit 0dda39e into master Mar 17, 2018
@HDVinnie HDVinnie deleted the Refactor-All-Controllers branch April 13, 2018 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant