1. Go to this page and download the library: Download fx/platform 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/ */
// App\Providers\AppServiceProvider
use Fx\Platform\Facades\Platform;
use App\Repositories\Contacts\UserRepository;
use App\Repositories\Admin\UserRepository as DefaultUserRepository;
public function register()
{
// others ...
// UserRepository
Platform::register(UserRepository::class, DefaultUserRepository::class);
// Or
// Platform::registerGroup([UserRepository::class => DefaultUserRepository::class]);
}
// App\Http\Controllers\HomeController
use App\Repositories\Contacts\UserRepository;
public function test(UserRepository $user)
{
// do somethings with $user
// eg: $users = $user->get();
}
bash
php artisan platform:init
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.