PHP code example of imdhemy / repovel

1. Go to this page and download the library: Download imdhemy/repovel 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/ */

    

imdhemy / repovel example snippets


public function store(StoreBlogPostRequest $request)
{
    return new StoreBlogPost($request);
}

$service = new StoreBlogPost;

/**
 * Execute service
 *
 * @return mixed
 */
public function handle()
{
    // do some stuff
}

$name = $this->input('name');
$validated_name = $this->validated('name');
$all_input = $this->all();



namespace App\Http\Services;

use Imdhemy\Repovel\Contracts\AbstractService as Service;
use App\Repositories\DummyRepository;

class DummyClass extends Service
{
    /**
     * Execute service
     *
     * @return mixed
     */
    public function handle()
    {
        $repository = new DummyRepository();
        $dummies = $repository->all();
        return $dummies;
    }
}

return [
    /**
     * ---------------------------------------------------
     * Services configuration
     * ---------------------------------------------------
     *
     */
    'services'  => [
        'namespace' => '\Http\Services' // Default namespace for the services
    ],

     /**
     * ---------------------------------------------------
     * Repositories configuration
     * ---------------------------------------------------
     *
     */
    'repositories' => [
        'namespace' => '\Repositories' // Default namespace for the repositories
    ]
];

php artisan make:service StoreBlogPost

php artisan make:service StoreBlogPost -r

php artisan make:repository PostRepository

php artisan vendor:publish --tag=repovel-configs