viitech / laravel-dev-helpers
Laravel Dev Helper Functions
Installs: 1 880
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 7
Forks: 0
Open Issues: 0
Requires
- api-ecosystem-for-laravel/dingo-api: dev-laravel-9-support
- aws/aws-sdk-php-laravel: 3.*
- bensampo/laravel-enum: 1.*|2.*|3.*|4.*|5.*
- darkaonline/l5-swagger: 5.*|6.*|7.*|8.*
- doctrine/dbal: 2.*|3.*
- google/apiclient: 2.*
- guzzlehttp/guzzle: 6.*|7.*
- laravel/tinker: 1.*|2.*
- league/flysystem: 1.*|2.*|3.*
- league/flysystem-aws-s3-v3: 1.*|2.*|3.*
- m4tthumphrey/php-gitlab-api: 9.*|10.*|11.*
- nesbot/carbon: 1.*|2.*
- ramsey/uuid: 3.*|4.*
- sentry/sentry-laravel: 0.*|1.*|2.*
- spatie/laravel-backup: 5.*|6.*|7.*|8.*|9.*
- symfony/process: 4.*|5.*|6.*
- tymon/jwt-auth: 0.*|1.*|2.*
- webpatser/laravel-uuid: 3.*|4.*
- zanysoft/laravel-zip: ^1.0
Requires (Dev)
- laravel/laravel: 5.*|6.*|7.*|8.*|9.*
- laravel/lumen-framework: 5.*|6.*|7.*|8.*|9.*
Suggests
- dingo/blueprint: API Blueprint documentation generator.
README
Laravel Dev Helper Functions
Installation
composer require viitech/laravel-dev-helpers:master
Middleware
- CORS Middleware
\VIITech\Helpers\Middleware\CorsMiddleware::class
- Force HTTPS Middleware
\VIITech\Helpers\Middleware\ForceHttpsMiddleware::class
Console
Environment Set Value
- Add
\VIITech\Helpers\Console\EnvironmentSetCommand::class
toKernal.php
- Run
php artisan env:set app_name Example
Dingo API Custom Exception Handler
- Add
DingoAPIHelpers::exceptionHandler(App\Exceptions\Handler::class);
tobootstrap/app.php
Dingo API Routes List
- Add
\VIITech\Helpers\Console\DingoRoutesList::class
toKernal.php
- Run
php artisan route:list && php artisan api:routes
Packagist
Lumen Routes List
- Register service provider in bootstrap.app
\VIITech\Helpers\Packagist\LumenRoutesListHelper::registerServiceProvider($app)
- Run
composer dump-autoload && php artisan route:list
Laravel Tinker
- Register service provider in bootstrap.app
\VIITech\Helpers\Packagist\TinkerHelper::registerServiceProvider($app)
- Run
php artisan tinker
Sentry
- Register service provider in bootstrap.app
\VIITech\Helpers\Packagist\SentryHelper::registerServiceProvider($app)
- Add
SentryHelper::capture($this, $e);
toHandler.php
Security Checker
- Run
php vendor/sensiolabs/security-checker/security-checker security:check
Lumen Vendor Publish
- Add
\Laravelista\LumenVendorPublish\VendorPublishCommand::class
toapp/Console/Kernel.php
- Run
php artisan vendor:publish
Dingo API and JWT
Enable custom array serializer
- Add
CustomDingoSerializerProvider::class
to Service Provider inbootstrap/app.php
- Add
API_CUSTOM_SERIALIZER=true
to.env
Enable JWT
- Add
CustomDingoSerializerProvider::class
to Service Provider inbootstrap/app.php
- Add
API_ENABLE_JWT=true
to.env
Functions
Global Helpers
- Check App Environment
\VIITech\Helpers\GlobalHelpers::checkEnvironment()
- Check Is Development Environment
\VIITech\Helpers\GlobalHelpers::isDevelopmentEnv()
- Check Is Staging Environment
\VIITech\Helpers\GlobalHelpers::isStagingEnv()
- Check Is Production Environment
\VIITech\Helpers\GlobalHelpers::isProductionEnv()
- Check Is Testing Environment
\VIITech\Helpers\GlobalHelpers::isTestingEnv()
- Get Binary Path
\VIITech\Helpers\GlobalHelpers::getBinaryPath()
- Is Valid Object
\VIITech\Helpers\GlobalHelpers::isValidObject()
- Return String
\VIITech\Helpers\GlobalHelpers::returnString()
- Return Boolean
\VIITech\Helpers\GlobalHelpers::returnBoolean()
- Convert String Array To Integer Array
\VIITech\Helpers\GlobalHelpers::convertStringArrayToIntegerArray()
- Get Value From HTTP Request
\VIITech\Helpers\GlobalHelpers::getValueFromHTTPRequest()
- Get Value as Type
\VIITech\Helpers\GlobalHelpers::getValueAsType()
- Convert Comma Separated String to Array
\VIITech\Helpers\GlobalHelpers::convertCommaSeparatedStringToArray()
- Get Readable Boolean
\VIITech\Helpers\GlobalHelpers::getReadableBoolean()
- Run Shell Command
\VIITech\Helpers\GlobalHelpers::runShellCommand()
- Run Command In Server
\VIITech\Helpers\GlobalHelpers::runCommandInServer()
- Validate Variable with Alternative
\VIITech\Helpers\GlobalHelpers::validateVarWithAlternative()
- Return JSON Response (version 1)
\VIITech\Helpers\GlobalHelpers::returnResponse()
- Return Formatted JSON Response (version 2)
\VIITech\Helpers\GlobalHelpers::formattedJSONResponse()
- Return JSON Response
\VIITech\Helpers\GlobalHelpers::returnJSONResponse()
- Generate Random Number
\VIITech\Helpers\GlobalHelpers::generateRandomNumber()
- Get Page Title From URL
\VIITech\Helpers\GlobalHelpers::getPageTitle()
- Is String English?
\VIITech\Helpers\GlobalHelpers::isEnglish()
- URL Exists?
\VIITech\Helpers\GlobalHelpers::urlExists()
- Get Web Page Content
\VIITech\Helpers\GlobalHelpers::getWebPageContent()
- Check if variable is valid
\VIITech\Helpers\GlobalHelpers::isValidVariable()
- Return value from nullable object
\VIITech\Helpers\GlobalHelpers::returnValueFromNullableObject()
- Return value from nullable object
\VIITech\Helpers\GlobalHelpers::getUniqueIDsFromArray()
- Return Integer
\VIITech\Helpers\GlobalHelpers::returnInteger()
- Format Number
\VIITech\Helpers\GlobalHelpers::formatNumber()
- Return Float
\VIITech\Helpers\GlobalHelpers::returnFloat()
- Hash Password
\VIITech\Helpers\GlobalHelpers::hashPassword()
- Convert Hex to RGB
\VIITech\Helpers\GlobalHelpers::hex2rgb()
- Set Laravel Environment Value
\VIITech\Helpers\GlobalHelpers::setLaravelEnvironmentValue()
- Return Boolean as String
\VIITech\Helpers\GlobalHelpers::returnBooleanString()
- Create Dingo API Request Object
\VIITech\Helpers\GlobalHelpers::createAPIRequestObject()
- Is Mobile Platform
\VIITech\Helpers\GlobalHelpers::isPlatformMobile()
- Validate Request
\VIITech\Helpers\GlobalHelpers::validateRequest()
- Return Readable Text
\VIITech\Helpers\GlobalHelpers::readableText()
- Return Boolean Array
\VIITech\Helpers\GlobalHelpers::returnBooleanArray()
- Generate UUID
\VIITech\Helpers\GlobalHelpers::generateUUID()
- Offset Unset Attributes from Request
\VIITech\Helpers\GlobalHelpers::offsetUnsetAttributesFromRequest()
- Get Value from HTTP $_GET Request
\VIITech\Helpers\GlobalHelpers::getValueFromHTTPGETTRequest()
Google Helpers
- Validate Google reCaptcha
\VIITech\Helpers\GoogleHelpers::validateRecaptcha()
- Validate Google Token
\VIITech\Helpers\GoogleHelpers::validateGoogleToken()
Gitlab Helpers
- List All Gitlab Projects
\VIITech\Helpers\GitlabHelpers::listGitlabProjects()
- List Gitlab Issues
\VIITech\Helpers\GitlabHelpers::listGitlabIssues()
- Create Gitlab Issue
\VIITech\Helpers\GitlabHelpers::createGitlabIssue()
- Close Gitlab Issue
\VIITech\Helpers\GitlabHelpers::closeGitlabIssue()
- Delete Gitlab Issue
\VIITech\Helpers\GitlabHelpers::deleteGitlabIssue()
Slack Helpers
- Send Slack Message
\VIITech\Helpers\SlackHelpers::sendSlackMessage()
- Send Slack Message with Details
\VIITech\Helpers\SlackHelpers::sendSlackWithDetails()
Firebase Helpers
- Generate Dynamic Link
\VIITech\Helpers\FirebaseHelpers::generateDynamicLink()
- Send Firebase Cloud Message
\VIITech\Helpers\FirebaseHelpers::sendFCM()
Carbon Helpers
- Generate Now Timestamp
\VIITech\Helpers\CarbonHelper::generateNowTimestamp()
- Get Timestamp from Carbon instance
\VIITech\Helpers\CarbonHelper::toTimestamp()
- Get Formatted Carbon Date From UTC Date Time
\VIITech\Helpers\CarbonHelper::getFormattedCarbonDateFromUTCDateTime()
Lumen Helpers
- Initialize ResponseFactory
\VIITech\Helpers\LumenHelpers::initResponseFactory()
Mongo Helpers
- Unset Key From Collection
\VIITech\Helpers\MongoHelpers::unsetKeyFromMongodbCollection()
Dingo API Helpers
- Custom Exception Handler
VIITech\Helpers\Packagist\DingoAPI\DingoAPIHelpers::exceptionHandler()
- Create Request Object
VIITech\Helpers\Packagist\DingoAPI\DingoAPIHelpers::createRequestObject()