Skip to content

qwertukg/Cook-Laravel3-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cook Laravel3 Generator

Description

Improves Laravel3 Migrator.

Allows generating bundles, with all stuff, from Laravel3 migrations, by your own templates.

Instalation

All this must be done after full Laravel3 instalation.

Before all you must add Cook bundle to your bundles.php file like this:

return array(
    'cook'
);

After this start Cook manually in your main route.php file:

Bundle::start('cook');

Last step, is installing Cook Storage. It's not allows regenerate changing files. Open CLI and run Artisan command:

php artisan migrate:install_cook

Instalation done!

Usage

Cook allready have template for Laravel Engine, but can write your own template (looks next paragraph) for any purpose, even for nativ Larevel3.

Create empty budnle and write usual migration for him, like this:

class Attributes_Create_Attributes_Table {

	public function up()
	{
		Schema::table('attributes', function($t)
		{
			$t->create();
			$t->increments('id');
			$t->string('title');
			$t->text('description');
			$t->integer('value_id')->unsigned();
			$t->timestamps();
		});
	}

	public function down()
	{
		Schema::drop('attributes');
	}

}

To afford Cook generating code for this bundle - replace native Laravel Schema by Cook Schema. Just add:

use Cook\Laravel\Schema;

And then you wil run you migration, just add --tpl=EngineBundle after migrate command. And Cook create all code for you!

EngineBundle - is name of template folder.

Cook generating code just for migration where Schema is replaced.

Cook automaticly destroy files when you rollbak migration.

Cook do not delete/replace files changes by you.

Templating

Comming soon...

Look EngineBundle there are lot of examples ;)

Cool stuff

Comming soon...

About

Kitchen for code cooking

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages