2017 © Pedro Peláez
 

utility laravel-access-validated-inputs

Ensures input accessed from a Laravel request object is validated

image

timacdonald/laravel-access-validated-inputs

Ensures input accessed from a Laravel request object is validated

  • Tuesday, April 25, 2017
  • by timacdonald
  • Repository
  • 1 Watchers
  • 1 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Validated Input Access Trait

End of Life

The functionality provided by this is now baked directly into Laravel 5.5+ thanks the Joseph Silber. You should use that 👍, (*1)


A trait you can utilise in your Laravel form request objects to ensure the data you are accessing from the request has been validated., (*2)

Why? See my post: Enforcing Valid Data Access From a Form Request Object., (*3)

Installation

You can install using composer from Packagist., (*4)

composer require timacdonald/laravel-access-validated-inputs

Versioning

This package uses Semantic Versioning. You can find out more about what this is and why it matters by reading the spec or for something more readable, check out this post., (*5)

Usage

First you need to use the trait in your form request object:, (*6)

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use TiMacDonald\Http\Request\AccessesValidatedInputs;

class PostFormRequest extends FormRequest
{
    use AccessesValidatedInputs;

    //
}

Then in your controller you may call:, (*7)

<?php

namespace App\Http\Controllers;

use App\Post;
use App\Http\Requests\PostFormRequest;

class PostController extends Controller
{
    public function store(PostFormRequest $form)
    {
        Post::create($form->validatedInputs());

        //
    }
}

Contributing

Please feel free to suggest new ideas or send through pull requests to make this better. If you'd like to discuss the project, feel free to reach out on Twitter., (*8)

What next?

I've been thinking this could be awesome if it actually removed all the unvalidated inputs automatically so that all the Request's native methods only, intersect etc return validated inputs., (*9)

License

This package is under the MIT License. See LICENSE file for details., (*10)

The Versions

25/04 2017

dev-master

9999999-dev

Ensures input accessed from a Laravel request object is validated

  Sources   Download

MIT

laravel validation

22/04 2017

v1.0.1

1.0.1.0

Ensures input accessed from a Laravel request object is validated

  Sources   Download

MIT

laravel validation

10/04 2017

v1.0

1.0.0.0

Ensures input accessed from a Laravel request object is validated

  Sources   Download

MIT