Download the PHP package billyranario/prostarterkit without Composer
On this page you can find all versions of the php package billyranario/prostarterkit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download billyranario/prostarterkit
More information about billyranario/prostarterkit
Files in billyranario/prostarterkit
Package prostarterkit
Short Description A Laravel package that provides a set of utilities for rapid development. Typical structure for senior developers to start a new project.
License MIT
Informations about the package prostarterkit
ProstarterKit by Billy Joel Ranario
Description
ProstarterKit
is a Laravel package designed to expedite the initial setup and ongoing development of Laravel projects. It serves as a boilerplate, providing a collection of utilities, helpers, and core functionalities that are commonly used in Laravel applications.
This package includes a robust BaseRequest
class that provides various methods for input transformation and validation. The package also integrates seamlessly with Data Transfer Objects (DTOs), giving you the flexibility to work with data in an organized manner.
Whether you're building a simple API backend, a complex web application, or anything in between, ProstarterKit
aims to streamline your development process, enabling you to focus more on business logic and less on boilerplate code.
Requirements
- PHP version: 7.4 and above
- Laravel version: 6.0 and above
Features
- Input Transformation: Easily transform request data types with methods like getInputAsString, getInputAsInt, getInputAsFloat, and more.
- DTO Integration: Comes with a built-in support for DTOs, allowing for easy mapping of request data to data transfer objects.
- Highly Customizable: Designed to be flexible, allowing you to extend or override the built-in functionalities according to your project's needs.
- Easy to Use: Just a composer require away from being used in any Laravel application.
Table of Contents
- Installation
- Usage Examples
- Available Classes
- BaseRequest
- BaseDto
- ResponseHelper
- ServiceResponse
- UserRepositoryInterface
- ProstarterKitServiceProvider
- Helper Classes
- LoggerHelper
- Contributing
- License
Installation
Usage Examples
Below is a quick example of how you can use BaseRequest
and BaseDto
together:
Available Classes
ResponseHelper
The ResponseHelper
class provides methods for sending HTTP responses.
Usage
ServiceResponse
The ServiceResponse
class encapsulates a standard service response object.
Usage
BaseDto
The BaseDto
class serves as a base data transfer object for handling query parameters like pagination, sorting, etc.
Usage
UserRepositoryInterface
The UserRepositoryInterface
serves as the contract for any class that wants to interact with User data storage.
Methods
findById(int $id): ?User:
Find a user by ID.findByEmail(string $email): ?User:
Find a user by email.create(array $data): User|bool:
Create a new user.update(array $data, int $id): User|bool:
Update an existing user.delete(int $id): bool|null:
Delete a user by ID.
Usage
ProstarterKitServiceProvider
The ProstarterKitServiceProvider
class provides the bootstrapping logic for the package.
Usage
Usually, you don't need to interact with this class directly. Laravel will automatically register and boot the provider
BaseRequest
The BaseRequest
class extends Laravel's FormRequest
and provides methods for typecasting request inputs. It is commonly used together with DTOs to fill in data.
Usage with DTOs
Helper Classes
LoggerHelper
The LoggerHelper
class provides methods for logging messages to the application's log files.
Usage
Contributing
Contributions are welcome. Please submit a PR or open an issue.
License
This package is open-source and licensed under the MIT License.