Download the PHP package packettide/bree without Composer

On this page you can find all versions of the php package packettide/bree. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package bree

bree

Bree

Bree provides an interface to associate fieldtypes with existing Eloquent model attributes.

This project is still in an early stage and breaking changes may be made.

Build Status

Installation

With Laravel 4 and Composer

  1. Add "packettide/bree": "1.x" to your 'require' block in composer.json
  2. Run composer update
  3. Add 'Packettide\Bree\BreeServiceProvider', to the $providers array in app/config/app.php
  4. Then publish all Bree assets - php artisan bree:assets

Basic Usage

In this section we'll cover the fundamentals of how to interact with Bree. Bree functions by wrapping an existing Eloquent model and attaching field definitions to model attributes.

Defining Bree fields within routes/controllers

$book = new Bree('Book', array(
            'title'  => array('type' => 'Text')
        ));

Defining Bree fields within Eloquent Models

In app/models/Book.php

<?php

class Book extends Eloquent {

    public $breeFields = array(
        'title' => array('type' => 'Text')
    );

Note that you can define a base field mapping in your model and override fields in a route if desired.

Display a new model

$book = new Bree('Book');
echo $book; //this will output fields for all defined attributes

Display an existing model

$book = new Bree('Book');
$book->find(1);
echo $book;

Displaying a Bree field

If you don't wish to display all Bree fields from a model or would like to control the order you can use the model attributes in your views like so:

// Route
$book = new Bree('Book');
return View::make('books.create', array('book' => $book));

// View
{{ $book->title }} // this will output the label if available, followed by the field
{{ $book->title->field() }} // outputs the field only
{{ $book->title->label() }} // outputs the label only

Updating/Saving data

$input = Input::except('_token');
$book = new Bree('Book');

foreach($input as $key => $value)
{
    $book->$key = $value;
}

$book->save();

Field Definitions

Here is an example of what a field definition looks like:

array('comments' => array('type' => 'Relate', 'label' => 'Book Comments', 'related' => 'Comment', 'title' => 'title'))

Core Field Types

The following field types are available by default:

Using Other Fields

Adding another field package to your project typically involves adding the dependency to your composer.json file and registering the service provider with your application. Here are a few field packages which have more detailed instructions on their project pages:

Scaffolding with Bree

While Bree is a simple layer to add over an existing Eloquent model you may find it tedious to setup the mapping of fields to attributes and model relations etc… We have another package called Sire, which helps alleviate this problem while also providing a simple way to scaffold an application with Bootstrap 3.

Extending Bree

Bree is built to be a flexible and extensible base allowing for the creation of field types as they are required by a project. To learn more about creating your own field package start here.

License

Bree is open-sourced software licensed under the MIT license


All versions of bree with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
illuminate/support Version 4.1.x
illuminate/database Version 4.1.x
symfony/http-foundation Version 2.4.*
packettide/bree-fs-advanced Version dev-master
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package packettide/bree contains the following files

Loading the files please wait ....