本文整理汇总了PHP中Portfolio::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Portfolio::create方法的具体用法?PHP Portfolio::create怎么用?PHP Portfolio::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Portfolio
的用法示例。
在下文中一共展示了Portfolio::create方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
/**
* Store a newly created portfolio in storage.
*
* @return Response
*/
public function store()
{
$all = Input::all();
$rules = Portfolio::$rules;
$validator = $this->validateSlugOnCreate($all, $rules);
if ($validator->fails()) {
return Redirect::back()->withErrors($validator)->withInput();
}
Portfolio::create($all);
return Redirect::route('admin_portfolio');
}
示例2: run
public function run()
{
DB::table('portfolios')->truncate();
DB::table('portfolios')->delete();
Portfolio::create(array('user_id' => '1', 'title' => 'Наша работа заголовок', 'link' => 'best', 'description' => 'Наша работа описание', 'images' => 0, 'active' => 1, 'meta_title' => 'Наша работа мета заголовок', 'meta_description' => 'Наша работа мета описание', 'meta_keywords' => 'Наша работа ключевые слова'));
}
示例3: createPortfolio
public function createPortfolio($data = array())
{
$pf = new Portfolio($data);
return $pf->create();
}
示例4: run
public function run()
{
DB::table('portfolios')->truncate();
Portfolio::create(['title' => "Portfolio 1", 'body' => 'This is your portfolio page 1', 'published' => 1, 'order' => 1, 'seo' => 'Portfolio 1 SEO', 'slug' => '/portfolio1']);
Portfolio::create(['title' => "Portfolio 2", 'body' => 'This is your portfolio page 2', 'published' => 1, 'order' => 1, 'seo' => 'Portfolio 2 SEO', 'slug' => '/portfolio2']);
}