PHP code example of candasm / lafres

1. Go to this page and download the library: Download candasm/lafres library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

candasm / lafres example snippets


 

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Candasm\Lafres\SanitizeWhenResolvedTrait;

abstract class Request extends FormRequest {
	use SanitizeWhenResolvedTrait;
	
	//
}




namespace App\Http\Requests;

use App\Http\Requests\Request;
use Candasm\Lafres\SanitizeFormRequest;

class StoreBlogPostRequest extends Request implements SanitizeFormRequest
{

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title' => '

...
	public function store(StoreBlogPostRequest $request)
	{
		$attributes = $request->all();
		$blogPost = BlogPost::create($attributes);
	}
...