當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Tag::save方法代碼示例

本文整理匯總了PHP中app\Tag::save方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tag::save方法的具體用法?PHP Tag::save怎麽用?PHP Tag::save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Tag的用法示例。


在下文中一共展示了Tag::save方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: store

 public function store(TagRequest $request)
 {
     $tag = new Tag($request->all());
     $tag->save();
     Flash::success("Se ha agregado el tag " . $tag->name . " de manera exitosa!");
     return redirect()->route('admin.tags.index');
 }
開發者ID:gratereaux,項目名稱:practicing-laravel,代碼行數:7,代碼來源:TagsController.php

示例2: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(TagRequest $request)
 {
     $tag = new Tag($request->all());
     $tag->save();
     Flash::success('El tag ' . $tag->name . ' ha sido creado con éxito.');
     return redirect()->route('admin.tags.index');
 }
開發者ID:JoseDguez,項目名稱:laravel-project,代碼行數:13,代碼來源:TagsController.php

示例3: store

 public function store(TagRequest $request)
 {
     $tag = new Tag($request->all());
     $tag->save();
     Flash::success('El tag ' . $tag->nombre . ' se registro con exito!!');
     return redirect()->route('admin.tags.index');
 }
開發者ID:kyrayagami,項目名稱:proyecto,代碼行數:7,代碼來源:TagsController.php

示例4: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['new-post-tag' => 'required']);
     $tag = new Tag(array('title' => $request->get('new-post-tag'), 'slug' => str_slug($request->get('new-post-tag'))));
     $tag->save();
     return $this->getAllTags();
 }
開發者ID:leloulight,項目名稱:RealMadrid,代碼行數:13,代碼來源:TagController.php

示例5: store_tag

 public function store_tag(Request $request)
 {
     $name = $request->name;
     $tag = new Tag();
     $tag->name = $name;
     $tag->save();
     return redirect('manage/producttags');
 }
開發者ID:Kaelcao,項目名稱:colormev2,代碼行數:8,代碼來源:TagController.php

示例6: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $tag = new App\Tag();
     $tag->user_id = \Auth::user()->id;
     $tag->name = $request->name;
     $tag->save();
     return $tag;
 }
開發者ID:jorions,項目名稱:bocket,代碼行數:14,代碼來源:TagsController.php

示例7: seedTags

 private function seedTags($faker)
 {
     foreach (range(0, 100) as $number) {
         $tag = new Tag();
         $tag->name = $faker->word;
         $tag->save();
     }
 }
開發者ID:alexbonavila,項目名稱:taskAPI,代碼行數:8,代碼來源:DatabaseSeeder.php

示例8: seedTags

 private function seedTags($faker)
 {
     foreach (range(0, 100) as $item) {
         $tag = new Tag();
         $tag->title = $faker->word;
         //            $tag->prova = $faker->boolean();
         $tag->save();
     }
 }
開發者ID:Germangalia,項目名稱:tasksAPI,代碼行數:9,代碼來源:DatabaseSeeder.php

示例9: seedTags

 private function seedTags($faker)
 {
     foreach (range(0, 100) as $number) {
         $tag = new Tag();
         $tag->title = $faker->word;
         // $tag->onoff =$faker->boolean;
         $tag->save();
     }
 }
開發者ID:OscarDuranX,項目名稱:tasksAPI,代碼行數:9,代碼來源:DatabaseSeeder.php

示例10: store

 public function store(TagRequest $request)
 {
     //$this->createTags($request);
     $tag = new Tag();
     $tag->name = $request->input('name');
     $tag->save();
     \Session::flash('flash_message', 'Tag has been added!');
     return redirect('tags');
 }
開發者ID:chrisguo1,項目名稱:To-Do-List,代碼行數:9,代碼來源:TagsController.php

示例11: store

 /**
  * Store the newly created tag in the database.
  *
  * @param TagCreateRequest $request
  * @return Response
  */
 public function store(TagCreateRequest $request)
 {
     $tag = new Tag();
     foreach (array_keys($this->fields) as $field) {
         $tag->{$field} = $request->get($field);
     }
     $tag->save();
     return redirect('/admin/tag')->withSuccess("The tag '{$tag->tag}' was created.");
 }
開發者ID:guduchango,項目名稱:l5beauty,代碼行數:15,代碼來源:TagController.php

示例12: seedTags

 public function seedTags($faker)
 {
     foreach (range(0, 100) as $number) {
         $tag = new Tag();
         $tag->name = $faker->word;
         $tag->random_bool = $faker->boolean;
         $tag->save();
     }
 }
開發者ID:albertmayor,項目名稱:tasksAPI,代碼行數:9,代碼來源:DatabaseSeeder.php

示例13: sendTags

 private function sendTags($faker)
 {
     foreach (range(0, 100) as $number) {
         $tag = new Tag();
         $tag->name = $faker->word;
         //$tag->tran = $faker->boolean;
         $tag->save();
     }
 }
開發者ID:pdavila13,項目名稱:tasksAPI2,代碼行數:9,代碼來源:DatabaseSeeder.php

示例14: seedTags

 /**
  * @param Faker $faker
  */
 private function seedTags(Faker $faker)
 {
     foreach (range(0, 100) as $item) {
         $tag = new Tag();
         $tag->name = $faker->world;
         $tag->prova = $faker->boolean();
         $tag->save();
     }
 }
開發者ID:rogermelich,項目名稱:tasksAPI,代碼行數:12,代碼來源:DatabaseSeeder.php

示例15: actionCreate

 public function actionCreate(Requests\CreateTagRequest $request)
 {
     // Create a new model instance and populate it with the request.
     $tag = new Tag($request->all());
     // Save tag in database.
     $tag->save();
     // Redirect with flash message.
     \Session::flash('flash_message', 'You have successfully created a tag.');
     return redirect('tags');
 }
開發者ID:JCStraw3,項目名稱:photos,代碼行數:10,代碼來源:TagController.php


注:本文中的app\Tag::save方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。