Download the PHP package bpez/infuse without Composer
On this page you can find all versions of the php package bpez/infuse. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package infuse
Infuse
Setup
Step 1: Add laravel5 path repo for toddish/verify package
Step 2: Install via composer
Step 3: Add the ServiceProvider
Step 4: Add to middleware
Step 5: Configure auth file
Step 6: Publish Configurations & public assets & run migrations
Step 7: Add to composer.json
Step 8: Add to .htaccess
Step 9: Run infuse migrations
Step 10: Add support to server retina images
Possible future features
Install artisan on sterioids
Behat infuse test suite
High level data flow
Infuse Configuration API
addSelect
Turn database field to a html form select. Take in single instanct or multiple.
Parameters
- column - (Required) [string] Database table field name
-
array - (Required) [array] Array of values. Formatted:
- insertBlank - (Optional) [boolean] Inserts a blank option to select field. Default value is false.
-
nested - (Optional) [array] Model only needed for first one. Every level after that array format required
- nestedLastArray - (Optional) [array] Array of level values
describeColumn
Adds a description to a database field.
Parameters
- column - (Required) [string] Database table field name
- desc - (Required) [string] Description
- popover (Optional) [boolean] If option present then descript displayed as html pop.
onlyOne
Only allow one database entry to be display and created.
addPermanentFilters
Add a SQL where clause to configuration.
Parameters
- column - (Required) [string] Database table field name
- operator - (Required) [string] SQL comparison opertator. If 'IN' is used for the operator then it use elequents whereIn($column, $value)
- value - (Required) [string | number] Value to be compared to
defaultColumnValues
Add a default value for when an entry is saved.
Parameters
- array - (Required) [array] Array of default values where the index is the column name and the value is the value for the index
addMultiSelect
Transform field to multiple select. Where IDs are kept track separated by a coma.
Parameters
- column - (Required) [string] Database table field name
- array - (Required) [array] Array of values. Formatted
hasMany
One To Many relationships are defined here. Define children relations like format below.
Parameters
- (Required) [string] Child model name
- (Required) [string] Display name for entries listed on parent edit page
- (Required) [array] Child columns to display on entries listed on parent edit page
- (Optional) [array] Contains extra functionality for dislaying child entries. Some options are as follows:
Ex. Child Columns array may have an array nested to match an id with a value like below:
array("category" => $categories)
Ex. For adding custom export and import functions.
Ex. Split table to act like 2 child tables separated by where clauses.
displayOrder
Changes column to an column to be used for ordering entries. Integer is used for the type. Makes field not editable by user and value automatically set.
Parameters
- Database table field names
fileUpload
Configure columns for file upload functionality.
Parameters
- column - (Required) [string] Database table field name
addCkeditor
Turns a text field to a addCkeditor.
Parameters
- Database table field names
callFunction
Add extra action to entry's actions (show | edit | delete | YourActionHere ). Returning an array("type" => "success", "message" => $message) can tap into notification system. Type can be ("success" || "error" || "info" || "warning"). Or returning false will trigger default error message.
Parameters
- (Required) [string] function - Name of the function. Its a laravel elequent query scope. So if name is importSomeThing then in the model it's declared scopeImportSomeThing
- (Required) [string] Display name for the function
- (Optional) [string] If its a lengthy process you can set a message that will populate a waiting modal while the process is running.
- (Optional) [string] Provide a target for the html anchor tag.
Ex. importSomeThing implementation. Returns an array to the admin marked with type ("success" || "error") and message along with it.
addOtherAction
Add top level action under the "Other Actions" dropdown on the scaffold listing page. Function should be static function from the top level model. User instance is passed into static function. Returning an array("type" => "success", "message" => $message) can tap into notification system. Type can be ("success" || "error" || "info" || "warning"). Or returning false will trigger default error message.
Parameters
- (Required) [string] function - Name of the function. Its a laravel elequent query scope. So if name is importSomeThing then in the model it's declared scopeImportSomeThing
- (Required) [string] Display name for the function
Ex. seedUrls implementation
editListingOrder
Lets you select the column ordering for the edit/create page. Pass in an array with the column names in the desired order.
Parameters
- (Required) [string] table field names
Eloquent ORM
Setup models to work with infuse by extending the InfuseModel and using InfuseModelLibrary trait.
InfuseModel features
url($columnName, $hstoreColumn = false)
Fetch the full url path for the file name saved to the specific column. Call the url method and pass in the column name as a parameter.
thumbor($columnName, $hstoreColumn = false)
Building on top of url functionality return an instance of a thumbor client. Only works on columns the have a file saved to them. Thumbor is a smart imaging service. It enables on-demand crop, resizing and flipping of images. Thumbor documentation and thumber client documentation can found here:
- https://github.com/thumbor/thumbor/wiki
- https://github.com/99designs/phumbor/blob/master/lib/Thumbor/Url/CommandSet.php
Services configuration required please see service configuration below for setup.
- When using with img tags add this data attribute: data-no-retina
Bpez\Infuse\Util
Util::thumbor($url)
Same functionality as InfuseModel url method. For other image resources.
- When using with img tags add this data attribute: data-no-retina
Util::cdn($url)
For delivering assets originating from same origin through CloudFront CDN. Services configuration required please see service configuration below for setup.
Services
/config/services.php
Retina image support
Include the Util::infuse() on your page (put it at the bottom of your template, before your closing