gem-partij / gemboot-lara
Gemboot Lara - Laravel package for supporting SMVC development method
Requires
- php: ^8.3
- guzzlehttp/guzzle: ^7.15.2
- irazasyed/telegram-bot-sdk: ^3.15
- laravel-notification-channels/telegram: ^6.0|^7.0
- laravel/framework: ^12.0|^13.0
Requires (Dev)
- orchestra/testbench: ^10.0|^11.0
- phpunit/phpunit: ^11.5.3|^12.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-master
- 8.0.0
- 7.0.6
- 7.0.5
- 7.0.4
- 7.0.3
- 7.0.2
- 7.0.1
- 7.0.0
- 6.x-dev
- 6.4.1
- 6.4.0
- 6.3.0
- 6.2.0
- 6.1.2
- 6.1.1
- 6.1.0
- 6.0.0
- 5.x-dev
- 5.4.0
- 5.3.1
- 5.3.0
- 5.2.0
- 5.1.1
- 5.1.0
- 5.0.1
- 5.0.0
- 4.x-dev
- 4.3.1
- 4.3.0
- 4.2.0
- 4.1.3
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.0
- 3.x-dev
- 3.4.5
- 3.4.4
- 3.4.3
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.0
- 3.2.0
- 3.1.5
- 3.1.4
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.x-dev
- 2.3.1
- 2.3.0
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.11
- 2.1.10
- 2.1.9
- 2.1.8
- 2.1.7
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.x-dev
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 0.5.x-dev
- 0.5.4
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- dev-chore/composer-update
- dev-fix/telegram-test-env
This package is auto-updated.
Last update: 2026-10-05 08:04:42 UTC
README
Laravel package for supporting SMVC development method
What It Does
Before installing gemboot package:
use App\Models\User; class UserControllerApi extends Controller { // method to return all users public function index() { $status = 200; $message = 'Success!'; $data = []; try { // add user data to response $data = User::all(); } catch(\Exception $e) { // if catch error... // log error \Log::error($e->getMessage()); \Log::error($e->getTraceAsString()); // add error response $status = 500; $message = "Internal Server Error"; $data = [ 'error' => $e->getMessage(), ]; } // return response json return response()->json([ 'status' => $status, 'message' => $message, 'data' => $data, ], $status); } }
After installing gemboot package:
use GembootResponse; use App\Models\User; class UserControllerApi extends Controller { // method to return all users public function index() { return GembootResponse::responseSuccessOrException(function() { return User::all(); }); } }
will get the same response:
/* Success Response */ { "status": 200, "message": "Success!", "data": [ /* all user data... */ ] } /* Error Response */ { "status": 500, /* it could be 400 to 500 error status code */ "message": "Error!", "data": [ /* all error data... */ ] }
Documentation, Installation, and Usage Instructions
See the DOCUMENTATION for detailed installation and usage instructions.
Support Policy
Only the latest version will get new features.
| Package Version | Laravel Version | PHP Version |
|---|---|---|
| 0.5.x | < 5.5 | |
| 1.x | ^5.5, ^6, ^7 | 7.2 - 8.0 |
| 2.x | 8 | 7.3 - 8.1 |
| 3.x | 9 | 8.0 - 8.2 |
| 4.x | 10 | 8.1 - 8.3 |
| 5.x | 11 | 8.2 - 8.3 |
| 6.x | 11 | ^8.2 |
| 7.x | ^11, ^12 | ^8.2 |
| 8.x (current) | ^12, ^13 | ^8.3 |
Upgrading from 7.x to 8.x
8.x adds Laravel 13 and PHP 8.5 support. There are no breaking changes for consumer code, only minimum requirement bumps:
- PHP minimum is now 8.3 (was 8.2)
- Laravel 11 is no longer supported. Laravel 11 stopped receiving security fixes in March 2026, and recent Composer versions refuse to install its releases because of unpatched security advisories. Stay on 7.x if you cannot upgrade Laravel yet.
- All internal method signatures use explicit nullable types (
?Typeinstead of implicitType = null) to satisfy PHP 8.4+ deprecation rules guzzlehttp/guzzleminimum is now 7.15.2. Earlier releases are affected by security advisories, including host-based check bypasses, and gemboot-lara sends auth tokens through Guzzle.laravel-notification-channels/telegramaccepts^7.0(Laravel 13 ecosystem)- PHPUnit
^12.0is supported in dev dependencies
Behavior changes worth checking:
CoreServicecaching (enabled withsetObserver()) now requires a cache store with tag support (redis, memcached, array). On file or database stores,listAll()andfindOrFail()read from the database directly, because cached entries could not be invalidated.- The Telegram exception notification and the debug trace in error responses are now read through
config(), so they keep working afterphp artisan config:cache.
If your project is already on PHP 8.3+ and Laravel 12/13, composer require gem-partij/gemboot-lara:^8.0 should be a drop-in upgrade.
Installation
Require the gem-partij/gemboot-lara package in your composer.json and update your dependencies:
composer require gem-partij/gemboot-lara
Optional: The service provider will automatically get registered. Or you may manually add the service provider in your config/app.php file:
'providers' => [ // ... \Gemboot\GembootServiceProvider::class, ];
Optional: The aliases will automatically get registered. Or you may manually add the gemboot aliases in your config/app.php file:
'aliases' => [ // ... // Exceptions 'GembootBadRequestException' => Gemboot\Exceptions\BadRequestException::class, 'GembootConflictException' => Gemboot\Exceptions\ConflictException::class, 'GembootForbiddenException' => Gemboot\Exceptions\ForbiddenException::class, 'GembootHttpErrorException' => Gemboot\Exceptions\HttpErrorException::class, 'GembootMethodNotAllowedException' => Gemboot\Exceptions\MethodNotAllowedException::class, 'GembootNotFoundException' => Gemboot\Exceptions\NotFoundException::class, 'GembootServerErrorException' => Gemboot\Exceptions\ServerErrorException::class, 'GembootServiceUnavailableException' => Gemboot\Exceptions\ServiceUnavailableException::class, 'GembootTooManyRequestsException' => Gemboot\Exceptions\TooManyRequestsException::class, 'GembootUnauthorizedException' => Gemboot\Exceptions\UnauthorizedException::class, 'GembootUnprocessableEntityException' => Gemboot\Exceptions\UnprocessableEntityException::class, 'GembootValidationFailException' => Gemboot\Exceptions\ValidationFailException::class, // Facades 'GembootAuth' => Gemboot\Facades\GembootAuthFacade::class, 'GembootPermission' => Gemboot\Facades\GembootPermissionFacade::class, 'GembootRequest' => Gemboot\Facades\GembootRequestFacade::class, 'GembootResponse' => Gemboot\Facades\GembootResponseFacade::class, 'GembootValidator' => Gemboot\Facades\GembootValidatorFacade::class, // Controllers 'GembootController' => Gemboot\Controllers\CoreRestController::class, 'GembootProxyController' => Gemboot\Controllers\CoreRestProxyController::class, 'GembootResourceController' => Gemboot\Controllers\CoreRestResourceController::class, // Model 'GembootModel' => Gemboot\Models\CoreModel::class, // Service 'GembootService' => Gemboot\Services\CoreService::class, ];
Gemboot Gateway (Additional Package)
⚠️ Deprecated since v8.0. The
CheckTokengateway middleware is no longer recommended for new projects and may be removed in a future major release. Use the per-route auth middleware described under Gemboot Auth instead.
Middleware (legacy)
To use Gemboot Gateway for all your routes, register the CheckToken middleware globally in bootstrap/app.php:
// bootstrap/app.php use Illuminate\Foundation\Configuration\Middleware; ->withMiddleware(function (Middleware $middleware) { $middleware->append(\Gemboot\Gateway\Middleware\CheckToken::class); })
Configuration
The defaults are set in config/gemboot_gw.php. Publish the config to copy the file to your own config:
php artisan vendor:publish --tag="gemboot-gateway"
Gemboot Auth (Additional Package)
Middleware
Register the TokenValidated, HasRole, and HasPermissionTo middleware aliases in bootstrap/app.php:
// bootstrap/app.php use Illuminate\Foundation\Configuration\Middleware; ->withMiddleware(function (Middleware $middleware) { $middleware->alias([ 'token-validated' => \Gemboot\Middleware\TokenValidated::class, 'role' => \Gemboot\Middleware\HasRole::class, 'permission' => \Gemboot\Middleware\HasPermissionTo::class, ]); })
Then apply them to your routes:
Route::middleware(['token-validated', 'role:admin'])->group(function () { // ... });
Configuration
The defaults are set in config/gemboot_auth.php. Publish the config to copy the file to your own config:
php artisan vendor:publish --tag="gemboot-auth"
Routes
add Gemboot AuthLibrary in your routes if you want to use it, example:
use Illuminate\Http\Request; use Gemboot\Libraries\AuthLibrary; Route::middleware('api')->prefix('auth')->group(function() { Route::post('login', function(Request $request) { return (new AuthLibrary)->login($request->npp, $request->password, true); }); Route::get('me', function() { return (new AuthLibrary)->me(true); }); Route::get('validate-token', function() { return (new AuthLibrary)->validateToken(true); }); Route::get('has-role', function(Request $request) { return (new AuthLibrary)->hasRole($request->role_name, true); }); Route::get('has-permission-to', function(Request $request) { return (new AuthLibrary)->hasPermissionTo($request->permission_name, true); }); Route::post('logout', function() { return (new AuthLibrary)->logout(true); }); });
Gemboot File Handler (Additional Package)
Configuration
The defaults are set in config/gemboot_file_handler.php. Publish the config to copy the file to your own config:
php artisan vendor:publish --tag="gemboot-file-handler"
File Handler Usage
Now you can upload image or document using gemboot file handler.
use Illuminate\Http\Request; use Gemboot\FileHandler\FileHandler; class ExampleController extends Controller { public function uploadImage(Request $request) { $image = $request->file_image; $new_filename = "Gambar.jpeg"; $save_path = "/gambar/2020"; return (new FileHandler($image)) ->uploadImage($new_filename, $save_path) ->object(); } }
The uploadImage, uploadDocument method returns an instance of Illuminate\Http\Client\Response, which provides a variety of methods that may be used to inspect the response:
$response->body() : string; $response->json($key = null) : array|mixed; $response->object() : object; $response->collect($key = null) : Illuminate\Support\Collection; $response->status() : int; $response->ok() : bool; $response->successful() : bool; $response->redirect(): bool; $response->failed() : bool; $response->serverError() : bool; $response->clientError() : bool; $response->header($header) : string; $response->headers() : array;
more at: https://laravel.com/docs/http-client#making-requests
Testing
Run the tests with:
composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security-related issues, please email anggerpputro@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.