Download the PHP package elnooronline/laravel-concerns without Composer
On this page you can find all versions of the php package elnooronline/laravel-concerns. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download elnooronline/laravel-concerns
More information about elnooronline/laravel-concerns
Files in elnooronline/laravel-concerns
Package laravel-concerns
Short Description The components that make up the Elnooronline's Laravel Projects
License MIT
Informations about the package laravel-concerns
Laravel Concerns
The components that make up the Elnooronline's Laravel Projects.
Install
Configuration
- Import
\Elnooronline\LaravelConcerns\Http\Controllers\Helperstrait in your base controller class
This feature enables to use flash() and getResourceName() methods.
-
flash(): This method will set flash session with localed message.- example :
getResourceName(): This method returns the resource name of the specified crud used inController,Request,Model.- example : If you have
UserControllerclass will returnsusers. and you can add custom resource name by adding$resourceNameproperty.
- example : If you have
-
All
Requestclasses should extends\Elnooronline\LaravelConcerns\Http\RequestsFormRequestclass.API :
getResourceName()parseLocale()- example :
insted of
getAproperRules()- example :
Filterable
First you should use
Filterabletrait in your model.Then run the following command to generate your filter class.
App\Http\Filters\UserFilter
Now you can use the filter from controller.
Example Url :
/users?type=admin
Eloquent Multiple Auth Provider
You should add 'eloquent.multiple' provider in your
config/auth.phpAdd
typecolumn in users table.In
Usermodel should add constants of user types.Also you should use
Elnooronline\LaravelConcerns\Models\Concerns\SingleTableInheritancetrait in user model to fill type in creating event.The
Elnooronline\LaravelConcerns\Models\Scopes\UserTypeScopeused to determine the user type when use the model. and should be added to all user type models.Now if your account type is
adminwill returnApp\Models\Admininstance when you callAuth::user()insted ofApp\Models\User.Note : the
App\Models\Adminmodel and other type models should extendsApp\Models\Usermodel.
All versions of laravel-concerns with dependencies
laracasts/flash Version ^3.0
laracasts/presenter Version ^0.2.1
elnooronline/laravel-locales Version ^1.0
ezyang/htmlpurifier Version ^4.10
spatie/laravel-medialibrary Version ^7.12
elnooronline/laravel-bootstrap-forms Version ^2.0