1. Go to this page and download the library: Download samagtech/bit-framework 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/ */
samagtech / bit-framework example snippets
ef\Context\Context;
class Handler implements \Bref\Event\Handler
{
public function handle($event, Context $context)
{
return 'Hello ' . $event['name'];
}
}
// bootstrap.php
use SamagTech\BitFramework\Application;
// $app->register(Provider::class) Funzione per registrare dei provider
// $app->bootDb() Da utilizzare nel caso di DB
return $app;
// FooProvider.php
class FooProvider implements \SamagTech\BitFramework\Contracts\Provider {
public function register () : void {
app()->bind(Foo::class, new Foo());
// Or
app()->bind(Foo::class, function () {
return new Foo();
})
}
}
class Foo extends Illuminate\Database\Eloquent\Model {}