mpociot/illuminate-contao

0.1.0 2015-10-20 07:54 UTC

This package is auto-updated.

Last update: 2024-12-24 10:55:47 UTC


README

Use Laravel classes in Contao CMS (WIP)

Installation via Composer

$ composer require mpociot/illuminate-contao

Usage

Validation

Important You need to copy the validation.php into this Contao directory:

TL_ROOT /system/lang/en/validation.php

use Mpociot\IlluminateContao\Validator;
$validator = Validator::make([], [
	"ean" => "required"
]);
if( $validator->fails() )
{
	$errors = $validator->errors();
}

Eloquent / Database

<?php
use Mpociot\IlluminateContao\EncapsulatedEloquentBase;

class UserProfile extends EncapsulatedEloquentBase
{

	protected $table = "user_profile";

	public function user()
	{
		return $this->belongsTo('User');
	}

}

Running Tests

$ composer test

License

This library is licensed under the MIT license. Please see License file for more information.