Download the PHP package ryne/laravel-starter without Composer
On this page you can find all versions of the php package ryne/laravel-starter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-starter
Laravel starter (ryne/laravel-starter)
Version 1.0
Laravel starter comes with helpful methods in making laravel projects
Installation
download the package via composer
composer require ryne/laravel-starter
Files, Classes and Methods
Files
- DBHelper.php - Database migration helper class
- Helpers.php - Global methods
- L0g.php - Custom message logs, uses the original laravel logging class \Log::class, this only helps the logging error to be arrange with second parameter as array
Classes
- DBHelper::class
- L0g::class
to use must call or use the class full path itself by:
or register the class in the app.php configuration in the aliases section to easily access its methods
Methods
***DBHelper::class
- keyDelete (DBHelper::keyDelete) - static method, use to delete foreign keys in the migration whenever rolling back some migration or simply removing existing foreign keys.
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');
***L0g::class
- info (L0g::info) - static method, use to make an information log in the storage folder, it uses the laravel \Log::class to output its log while this customize its output message
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']);
- error (L0g::info) - static method, use to make an error log in the storage folder, it uses the laravel \Log::class to output its log while this customize its output message
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:
***Helpers.php file
- _vers - use in blade files to import css/js/fonts/images or any other medias within the application that puts a version at end of its url. Version string will contain the modified timestamp of the file
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
- _trim - use to limit the number of characters of a string then puts a string at the end. If there is more than characters than the max limit then it will concatenate a string suffix that is given in the parameter
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..."
- _trimText - the same as the _trim() method, but will remove any html tags that is within the string
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..."
- _isRoute - use to check the current route of the page
Parameters:
- String $routeName - the route name to be check
Return: Bool/String false/"active"
Sample usage:
_isRoute('user.index')
License
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.
- Code — MIT License