ryne/laravel-starter is a Laravel package for laravel helper methods.
It currently has 0 GitHub stars and 173 downloads on Packagist (latest version 1.3.17).
Install it with composer require ryne/laravel-starter.
Discover more Laravel packages by ryne
or browse all Laravel packages to compare alternatives.
Last updated
Version 1.0
Laravel starter comes with helpful methods in making laravel projects
download the package via composer
composer require ryne/laravel-starter
to use must call or use the class full path itself by:
\Ryne\LaravelStarter\DBHelper
\Ryne\LaravelStarter\L0g
or register the class in the app.php configuration in the aliases section to easily access its methods
'aliases' => Facade::defaultAliases()->merge([
'DBHelper' => Ryne\LaravelStarter\DBHelper,
'L0g' => Ryne\LaravelStarter\L0g,
])->toArray(),
Parameters:
- String $tableName (required) - table of the foreign keys to be deleted
- String $key (required) - key name to be deleted
Return: void
Sample usage:
DBHelper::keyDelete('user_numbers', 'user_numbers_use_id_foreign');
Parameter:
- String $message - message to be log
- ...$params - will accept arrays and string as its value as an additional information about the log
Return: void
Sample usage:
\L0g::info('test log', ['data' => 'additional data']);
Parameter:
- String $message - message to be log
- ...$params - will accept arrays and string as its value as an additional information about the log
Return: void
Sample usage:
\L0g::error('test log', ['data' => 'additional data']);
Sample output:
[2022-04-10 03:01:21] local.ERROR: ***XController.php@xmethod:11***
Message: "test log"
| data: additional data
File trace:
file:
/var/www/dc/vendor/ryne/laravel-starter/src/L0g.php@39 Function: error()
/var/www/dc/app/Http/Controllers/XController.php@11 Function: xmethod()
/var/www/dc/vendor/laravel/framework/src/Illuminate/Routing/Controller.php@54 Function: callAction()
__________________________________________________________________________________________________
Parameters:
- String $urlFile - file url of the resource within the application public or storage folder
- Bool $onlyVersion - output the version only instead of the whole url + version, default is false
Return: String
Sample usage:
_vers('/images/logo.png');
Sample output:
https://localhost/images/logo.png?v=22343423
Parameters:
- String $string - string/text to be trimmed
- Int $limit - number of characters to cut, default is 50 characters
- String $withSuffix - suffix to be given if string exceed the limit
Return: String
Sample usage:
_trim('hello world', 7, '...')
Sample output:
"hello w..."
Parameters:
- String $string - string/text to be trimmed
- Int $limit - number of characters to cut, default is 50 characters
- String $withSuffix - suffix to be given if string exceed the limit
Return: Boolean true/false
Sample usage:
_trim('hello world', 7, '...')
Sample output:
"hello w..."
Parameters:
- String $routeName - the route name to be check
Return: Bool/String false/"active"
Sample usage:
_isRoute('user.index')
this package is free, open source, and GPL friendly. You can use it for commercial projects, open source projects, or really almost whatever you want.