Laravel controller for form validation skinny I'm trying to make controllers skinny as possible. I use repositories for accessing the database and I use Services to do other stuff. In this case, I use it to insert a new post to the database. For validation I use Jeffery Way's validation package for Laravel.

PostController.php

&lt;?php

use Laracasts\Validation\FormValidationException;

use Dnianas\Post\PostCreationService;
use Dnianas\Post\PostRepository;

use Dnianas\Forms\PostForm;

class PostController extends BaseController
{

    /*
     * Dnianas\Services\PostCreationService
     */
    protected $post;

    /*
    * The post repository
     */
    protected $posts;

    /**
     * @param PostForm $postForm
     * @param PostCreationService $post
     * @param PostRepository $postRepo
     */
    public function __construct(PostForm $postForm, PostCreationService $post, PostRepository $postRepo)
    {
        $this-&gt;posts = $postRepo;
        $this-&gt;postForm = $postForm;
        $this-&gt;post = $post;
    }

    public function index()
    {
        $this-&gt;beforeFilter('auth');
    }


    /**
     * @return \Illuminate\Http\JsonResponse
     */
    public function create()
    {
        // Get the input
        $input = Input::all();

        // Validate it
        try {
            $this-&gt;postForm-&gt;validate($input);
        } catch(FormValidationException $e) {
            return Response::json([
                'success' =&gt; 'false',
                'message' =&gt; 'You didn\'t enter anything, Post cannot be empty.'
            ]);
        }

        // Insert it to the database
        $post = $this-&gt;post-&gt;create($input, Auth::user()-&gt;id);

        // Get the html content from the view
        $html = View::make('posts.post', ['post_id' =&gt; $post-&gt;id])-&gt;render();

        // Return a message along with the html content
        return Response::json([
            'success' =&gt; 'true',
            'message' =&gt; 'Your post has been successfuly posted!',
            'post_html' =&gt; $html
        ]);

    }


PostForm.php

&lt;?php namespace Dnianas\Forms;

use Laracasts\Validation\FormValidator;

class PostForm extends FormValidator
{
    /**
     * Validation rules for when the user creates a post
     * @var array
     */
    protected $rules = [
        'post_content' =&gt; 'required'
    ];

}


PostCreationService.php

namespace Dnianas\Post;

class PostCreationService 
{

    /**
     * @param $input
     * @param $user_id
     * @return \Post
     */
    public function create($input, $user_id)
    {
        // Validation passed to we insert it to our database
        $post = new \Post;
        $post-&gt;post_content = $input['post_content'];
        $post-&gt;posted_date  = \Carbon::now();
        $post-&gt;user_id      = $user_id;
        $post-&gt;save();

        return $post;
    }
}


Is this controller skinny enough? Can it get any skinnier? If so, then how?
Check out Dwight Watson's Validating Trait. I like to use it with:

protected $throwValidationExceptions = true;


Validation of Eloquent models occurs automatically according to the rules defined on the model and if it fails, a ValidatingException is thrown that you can catch further up the application stack. For example, I might put the following exception handler somewhere like app/global/start.php

App::error(function (\Watson\Validating\ValidationException $exception)
{
    Log::error($exception);
    // I prefer 'success' =&gt; 'false' to be expressed in the response code
    return Response::json([
        'message' =&gt; $exception-&gt;getErrors()-&gt;first(),
    ], 422); // Unprocessable entity
});


Them my controllers end up looking more like this:

public function create()
{
    $input = Input::all();
    // Validation occurs automatically during object creation
    $post = $this-&gt;post-&gt;create($input, Auth::user()-&gt;id);
    $html = View::make('posts.post', ['post_id' =&gt; $post-&gt;id])-&gt;render();

    // I prefer "success" to be expressed by the 200 OK response code
    return Response::json([
        'message' =&gt; 'Your post has been successfully posted!',
        'post_html' =&gt; $html
    ]); // not specifying a response code implies 200 OK

}


But it's really just a matter of personal preference at this point. Your code looks good to me.

tl;dr +1 would pull &amp; merge