SapioBeasley / crudHelper by SapioBeasley

Helper provider to assist in general crud functions of a restful controller
194
1
2
Package Data
Maintainer Username: SapioBeasley
Maintainer Contact: andreas@sapioweb.com (Andreas Beasley)
Package Create Date: 2016-01-02
Package Last Update: 2016-03-12
Language: PHP
License: MIT
Last Refreshed: 2024-04-25 15:02:00
Package Statistics
Total Downloads: 194
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Crud Helper for Laravel 5+

Latest Stable Version Total Downloads Latest Unstable Version License

Installation

Include into your config/app.php, Sapioweb\CrudHelper\CrudHelperServiceProvider::class,

Use the helper in any controller you plan to use it in, use Sapioweb\CrudHelper\CrudyController as CrudHelper;

Usage

use Sapioweb\CrudHelper\CrudyController as CrudHelper;

dd(CrudHelper::index());

Available Methods

Grab all data for a given resource

CrudHelper::index($model, $relations = null)

Stores you data for a resource

CrudHelper::store($model, $createData)

Show a single resource

CrudHelper::show($model, $field = 'id', $id, $relations = null)

Preform a where query on relationships

CrudHelper::relationshipQuery($model, $relationships, $relationField = null, $relationshipQuery = null)

Create or update a resource

CrudHelper::createOrUpdate($model, $field, $id, $inputData)

Destroy a resource

CrudHelper::destroy($model, $field = 'id', $id)

Turn a regular string into a slug string

CrudHelper::slugify($text)

License

This software is open-sourced software licensed under the MIT license. For questions please email andreas@sapioweb.com or info@sapioweb.com or visit Sapioweb.com to learn more and get in contact