1. Go to this page and download the library: Download sofiakb/lumen-utils 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/ */
sofiakb / lumen-utils example snippets
// Register service provider
use Sofiakb\Lumen\Utils\Http\Controllers\Controller;
use Sofiakb\Lumen\Utils\Services\Service;
$app->register(Sofiakb\Lumen\Utils\Providers\LumenUtilsServiceProvider::class);
// Commands available
$commands = [
'app:name',
'key:generate',
'serve',
'set:env'
];
// Tools
class TableController extends Controller {
// Pass Service Namespace into $serviceClass
public function __construct(string $serviceClass = 'Service') {
parent::__construct($serviceClass);
}
public function all(){
return parent::all(); // TODO: Change the autogenerated stub
}
public function findBy(string $column,$id){
return parent::findBy($column,$id); // TODO: Change the autogenerated stub
}
public function findById($id){
return parent::findById($id); // TODO: Change the autogenerated stub
}
public function store(){
return parent::store(); // TODO: Change the autogenerated stub
}
public function update($id){
return parent::update($id); // TODO: Change the autogenerated stub
}
public function updateBy($column,$value){
return parent::updateBy($column,$value); // TODO: Change the autogenerated stub
}
public function search(){
return parent::search(); // TODO: Change the autogenerated stub
}
public function paginate($page){
return parent::paginate($page); // TODO: Change the autogenerated stub
}
}
class TableService extends Service {
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.