Downloads
Stars
Version
This project aims to make using Laravel framework more organized and extensible.
>=5.6
Run the following Command in your cli.
composer require hassanzohdy/mongez
Once its done run the following command to create the config/mongez.php
file.
php artisan vendor:publish --provider="HZ\Illuminate\Mongez\Providers\MongezServiceProvider"
<?php
use HZ\Illuminate\Mongez\Translation\Traits\Translatable;
class MyClass
{
use Translatable;
public function index()
{
$this->transUsers('users.name'); // will translate from `Users` module and `users` file and the keyword is `name
$this->transUsers('usersGroups.permissions'); // will translate from `Users` module and `usersGroups` file and the keyword is `permissions
}
}
date_response
.casts
property instead of dates
for date casting.UTCDateTime
in functions.php
file.ARRAYABLE_DATA
on listing as it is encoded to json.RepositoryManager.wrapMany
will return empty array without passing the collection to the resource if teh given array|collection is empty.config/mongez.php
configmisc
key to date
.CarbonImmutable
to immutable
under date
key.week_starts_at
and defaults to Saturday
.week_ends_at
and defaults to Friday
.getPaginationInfo
in the repository manager.getPaginateInfo
now is deprecated and will be removed in V3.0.first
method to return the first matched element, takes the same array options as listModels
and return one model.saveActionType
property to the repository, it can be used in setData
, and its value will depend on the current action, static::CREATE_ACTION
| static::UPDATE_ACTION
| static::PATCH_ACTION
.date_response
to format the given date to timestamp
humanTime
text
and format
outputs.localized_date
to convert the given date into formatted date based on the locale code.date_response
in the resource manager to collect dates.date
and date:between
filters to FILTER_BY
repository constant.carbonImmutable
feature to change the now
function into immutable carbon instance.LOCATION_DATA
constant to resource manager to return proper geo location data.LOCALIZED_COLLECTABLE_DATA
constant to resource manager to localize data that are in array list.WHEN_AVAILABLE
in resource manager if set to true
, it will strip out any missing value from the model so the resource will only return existing data without any default values for any missing data.Model
, Resource
and Filter
in the repository while creating child module to receive the child module name instead of the parent module.Translatable
trait.database
directory to be Database
.See full documentation in the wiki page.