Download the PHP package fk/laravel-utility without Composer
On this page you can find all versions of the php package fk/laravel-utility. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-utility
Utilities
Making laravel more practical
Database
Model
- Usage: Just extends
fk\utility\Database\Eloquent\Model
-
functionality
-
Add approach to get the sql to be executed. It's available by calling
In fact, it works for any method that returns a
fk\utility\Database\Eloquent\Builder
-
Modify pagination
- add access to custom fields when calling
toArray
- add access to
toFKStyle
- add access to custom fields when calling
-
Model::select related
Being able to using alias like following, see
\fk\utility\Database\Query\Builder::select
for more
-
Request
- Class
fk\utility\Http\Request
-
Usage
-
Capture at
public/index.php
- Extends or use it for IOC
- Register it's alias as
request
, to ensure every instance fallback to the singleton instance used to capture at entry index.php
-
- Functionality
- Add support for Content-Type
multipart/form-data
for methodPUT
- Add support for Content-Type
Session
Allow session to be actually applied just when called. Not when requested. This is useful for RESTFul APIs, for some doesn't need a session.
AppServiceProvider
or add to config/app.php
Also remember cancel registering of the \Illuminate\Session\SessionServiceProvider
At last, you should set the config/session.php
add
Also, remember to disable Laravel's start-on-every-request feature by comment the following if exists
If you have your own rule of session id,
you can overwrite the \fk\utility\Session\SessionServiceProvider::getAccessToken
to achieve that
Easy Authentication
Register Service Provider
fk\utility\Auth\Session\SessionGuardServiceProvider
Config
PHPUnit
TestCase
- Class:
fk\utility\Foundation\Testing\TestCase
- Benefits: Output for json would be human readable for Chinese characters
- Usage:
ACL Check
- Class:
fk\utility\Auth\Middleware\AclAuthenticate
-
Usages:
-
Create your own authentication class to place your rules
-
Register at
App\Http\Kernel
- Good to go. Define a route using middleware
auth.acl
-