Download the PHP package teepluss/categorize without Composer

On this page you can find all versions of the php package teepluss/categorize. 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 categorize

Multi Level Category.

Categorize is a category management for Laravel 4.

Installation

To get the lastest version of Theme simply require it in your composer.json file.

"teepluss/categorize": "dev-master"

You'll then need to run composer install to download it and have the autoloader updated.

Once Attach is installed you need to register the service provider with the application. Open up app/config/app.php and find the providers key.

'providers' => array(

    'Teepluss\Categorize\CategorizeServiceProvider'

)

Publish config using artisan CLI.

php artisan config:publish teepluss/categorize

Migrate tables.

php artisan migrate --package=teepluss/categorize

Usage

Creating category as a root.

$categorize = Categorize::prepare(array(
    'type'        => 'Product',
    'title'       => 'Hardware',
    'description' => 'Hardware is a ...'
));

$categorize->makeRoot();

Creating category as a child of parent.

$categorize = Categorize::prepare(array(
    'type'        => 'Product',
    'title'       => 'Hardware - CPU',
    'description' => 'CPU is a ...'
));

$parent = Categorize::getCategoryProvider()->findById(1);
// or
// $parent = Categorize::getCategoryProvider()->findByName('Hardware');

$categorize->makeChildOf($parent);

Moving to a new root.

$category = Categorize::getCategoryProvider()->findByName('Hardware - CPU');

$category->makeRoot();

Moving to another parent.

$category = Categorize::getCategoryProvider()->findByName('Hardware - CPU');

$parent = Categorize::getCategoryProvider()->findByName('Software');

$category->makeChildOf($parent);

Update information.

$category = Categorize::getCategoryProvider()->findByName('Hardware - CPU');
$category->fill(array(
    'title'       => 'Software - Office',
    'description' => 'Documenting'
));

$category->save();

Delete with children.

$category = Categorize::getCategoryProvider()->findByName('Hardware');

$category->deleteWithChildren();

List category as tree.

$category = Categorize::getCategoryProvider()->findByName('Hardware');

var_dump($category->getChildren()->toArray());

Build categories as tree.

$categories = Categorize::getCategoryProvider()->whereType('Blog')->get();

// Build only root categories.

$categories = Categorize::getCategoryProvider()->root()->whereType('Blog')->get();

var_dump(Categorize::tree($categories)->toArray());

Using categorize with model.

Define relation to model

public function categories()
{
    return $this->morphMany('Teepluss\Categorize\CategoryRelates\Relate', 'contentable');
}

Push content to a category.

$category = Categorize::getCategoryProvider()->findByName('Hardware - CPU');

$blog = Blog::find(24);
$blog->categories()->create(array('category_id' => $category->id));

List contents that belongs to a category.

$contentIds = Categorize::getCategoryProvider()->findById(1)->relates()->whereContentableType('Blog')->lists('contentable_id');
// or
// $contentIds = Categorize::getCategoryRelateProvider()->whereContentableType('Blog')->whereCategoryId(1)->lists('contentable_id');

$blogs = Blog::find($contentIds);

var_dump($blogs->toArray());

Support or Contact

If you have some problem, Contact [email protected]

Support via PayPal


All versions of categorize with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
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 teepluss/categorize contains the following files

Loading the files please wait ....