1. Go to this page and download the library: Download venoudev/results 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/ */
namespace App\Validators;
use Illuminate\Support\Facades\Validator;
use Venoudev\Results\Exceptions\CheckDataException;
class ExampleValidator
{
public static function execute($data){
$validator=Validator::make($data,[
// Your awesome laravel validations here
]);
if ($validator->fails()) {
$exception = new CheckDataException();
$exception->addFieldErrors($validator->errors());
throw $exception;
}
return;
}
}
php artisan make:action Example
namespace App\Actions;
class ExampleAction
{
public static function execute($data){
// Your awesome code here.
return;
}
}
php artisan make:service Example
namespace App\Services\Contracts;
interface ExampleService {
// Your awesome methods to implement here.
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.