PHP code example of sabirepo / repository

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

    

sabirepo / repository example snippets

 bash
 //bootstrap\app.php
 Add : $app->register(Sabirepo\Repository\Providers\RepositoryServiceProvider::class);
 bash
  //config\app.php
 'providers' => [
	...
	Sabirepo\Repository\Providers\RepositoryServiceProvider::class,
 ],

 'aliases' => [
	...
	'Repo' => Sabirepo\Repository\Facades\Repository::class,
 ],
 
	php artisan vendor:publish --tag=repository

use Sabirepo\Repository\Facades\Repository as Repo;
/**
 * $data: String | Object | Array
 * response interface: $data['status'] | $data['messages'] | $data['body']
*/
return Repo::response($data);