1. Go to this page and download the library: Download netsells/interface-binder 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/ */
netsells / interface-binder example snippets
return [
/*
|--------------------------------------------------------------------------
| Directories to scan for interfaces
|--------------------------------------------------------------------------
|
*/
'directories' => [
app_path('Features'),
app_path('Services'),
],
];
namespace App\Features\CodeVerifier;
use App\Models\User;
#[BoundTo(UserCodeVerifier::class)]
interface UserCodeVerifierInterface
{
public function verifyUserCode(User $user, string $codeGiven): bool;
}
namespace App\Features\CodeVerifier;
use App\Models\User;
class UserCodeVerifier implements UserCodeVerifierInterface
{
public function verifyUserCode(User $user, string $codeGiven): bool
{
return true;
}
}