本文整理匯總了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']);
}