omnicode / lara-support
Additions for laravel support
Installs: 11 496
Dependents: 6
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 3
Requires
- laravel/framework: 5.8.*
- omnicode/php-util: 5.0.*
Requires (Dev)
- mockery/mockery: ~1.0
- omnicode/lara-test: ~4.0
- orchestra/testbench: ~3.0
- phpunit/phpunit: ~7.0
This package is auto-updated.
Last update: 2024-10-29 04:42:14 UTC
README
Lara-Support
Useful classes/methods
LaraServiceProvider
mergeConfig($rootPath, $config = '', $isPublish = true)
loadViews($rootPath, $path = '', $isPublish = true)
loadRoutes ($rootPath, $path = '')
runningInConsole($commands)
registerFunctions($rootPath, $path = 'helpers.php')
registerConstants($rootPath, $path = 'constants.php')
registerSingleton($singleton, $class)
registerSingletons($singletons)
registerMiddleware($middleware)
registerProviders($providers)
registerAlias($alias, $class)
registerAliases($aliases)
getPackage($rootPath)
getPackagePath($rootPath)
getSrcPath($rootPath)
getConfigPath($rootPath)
getResourcePath($rootPath)
getViewVendorPath($path)
getViewPath($rootPath, $view = 'views')
getRoutePath($rootPath, $path = 'routes.php')
Str
positions($string, $search)
finds the given string's position in the text
return empty array or associative array
[
occurence => position
]
example
Str::positions('I love php, I love php too!','php')
returns
[
1 => 7
2 => 19
]
Str::positions('I love php, I love php too!','Php')
return []
ipositions($string, $search)
case-insesitive versino for positions
Str::ipositions('I love php, I love php too!','php')
returns
[
1 => 7
2 => 19
]
Str::ipositions('I love php, I love php too!','Php')
returns
[
1 => 7
2 => 19
]
after($subject, $search, $occurrence = 1, $caseSensitive = true)
Str::after('I love php, I love php too!','php')
return ", I love php too!"
Str::after('I love php, I love php too!','php', 2)
return " too!"
Str::after('I love php, I love php too!','php', 3)
return false
Str::after('I love php, I love php too!','php', Str::LAST)
return " too!"
Str::after('I love php, I love php too!','PHP', 2)
return false
Str::after('I love php, I love php too!','PHP', 2, false)
return " too!"
before
Str::before('I love php, I love php too!','php')
return "I love php, I love "
Str::before('I love php, I love php too!','PHP', 1)
return "I love "
Str::before('I love php, I love php too!','php', 2)
return "I love php, I love "
Str::before('I love php, I love php too!','php', 3)
return false
Str::before('I love php, I love php too!','PHP', 1)
return false
Str::before('I love php, I love php too!','PHP', 1, false)
return "I love "
between
wrap
iwrap
DB
getTable
return all db tables list
getColumnsFullInfo*
return list
[
coulumn => [
type => string | int |bigint |smallint
is_nullable => true | false,
default => default-value | null
extra => auto_increment | ''
length => length (This key set when column have lenght)
additioanal => unsigned | zerofill
]
]
*example is for mysql DB