定制 talyssonoc/phactory-laravel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

talyssonoc/phactory-laravel

最新稳定版本:v0.1

Composer 安装命令:

composer require talyssonoc/phactory-laravel

包简介

Use Phactory inside Laravel

README 文档

README

With Phactory Laravel you'll be able to use Phactory with Laravel 5.

If you don't know what Phactory is:

Phactory is an alternative to using database fixtures in your PHP unit tests. Instead of maintaining a separate XML file of data, you define a blueprint for each table and then create as many different objects as you need in your PHP code.

Phactory Laravel will access the database based on your Laravel config, simple as that.

Be aware that you must specify a testing database, otherwise Phactory Laravel will insert data in your development database.

Installation

First you need to add this to your composer.json requires:

	"talyssonoc/phactory-laravel": "dev-master"

Then set the minimum-stability of your dependencies to dev, adding this to your composer.json:

	"minimum-stability": "dev"

Then run:

	$ composer install

After that you should add this to your service providers (at config/app.php):

	'PhactoryLaravel\PhactoryServiceProvider'

And that to your aliases (at the same file):

	'Phactory'	=> 'PhactoryLaravel\\Phactory'

After that, Phactory facade will be available for you to use.

Creating a factory

Yours factories must be inside the folder app/Factories, and you should use the API provided by Phactory. The content of each file must be something like this:

<?php

	Phactory::define('user', [
	  'name' => 'UserName :D'
	]);

Laravel 5.1

Note that is is not entirely necessary with Laravel 5.1, since it has model factories out-of-box, but you can still use Phactory Laravel with Laravel 5.1 if you prefer.

To do

统计信息

  • 总下载量: 16
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固