当前位置: 首页>>代码示例>>PHP>>正文


PHP Language::get方法代码示例

本文整理汇总了PHP中app\Language::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Language::get方法的具体用法?PHP Language::get怎么用?PHP Language::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Language的用法示例。


在下文中一共展示了Language::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getAll

 public function getAll()
 {
     // Get All Languages
     $languages = Language::get();
     // Passing data to response service
     return $this->responseService->returnMessage($languages, 'No Languages were Found.');
 }
开发者ID:owemus,项目名称:personal_be,代码行数:7,代码来源:LanguageService.php

示例2: guardarTraduccion

 public function guardarTraduccion($request, $id)
 {
     $producto = Product::findOrFail($id);
     $producto->name = $request->input('name');
     $producto->description = $request->input('description');
     $producto->save();
     $languages = Language::get();
     foreach ($languages as $lang) {
         $nameLang = $request->input('name' . $lang->id);
         $descLang = $request->input('description' . $lang->id);
         if (trim($nameLang) != "" && trim($descLang) != "") {
             $languages_products = LanguageProduct::where('id_language', $lang->id)->where('id_product', $producto->id)->first();
             if (!isset($languages_products->id)) {
                 $languages_products = new LanguageProduct();
             }
             $languages_products->id_language = $lang->id;
             $languages_products->id_product = $producto->id;
             $languages_products->name = $nameLang;
             $languages_products->description = $descLang;
             $languages_products->save();
         } else {
             $languages_products = LanguageProduct::where('id_language', $lang->id)->where('id_product', $producto->id)->first();
             if (isset($languages_products->id)) {
                 $languages_products->delete();
             }
         }
     }
 }
开发者ID:serranozafra,项目名称:pruebaHectorSerrano,代码行数:28,代码来源:ProductController.php

示例3: guardarTraduccion

 public function guardarTraduccion($request, $id)
 {
     $categoria = Category::findOrFail($id);
     $categoria->name = $request->input('name');
     $categoria->save();
     $languages = Language::get();
     foreach ($languages as $lang) {
         $nameLang = $request->input('name' . $lang->id);
         if (trim($nameLang) != "") {
             $languages_categories = LanguageCategory::where('id_language', $lang->id)->where('id_category', $categoria->id)->first();
             if (!isset($languages_categories->id)) {
                 $languages_categories = new LanguageCategory();
             }
             $languages_categories->id_language = $lang->id;
             $languages_categories->id_category = $categoria->id;
             $languages_categories->name = $nameLang;
             $languages_categories->save();
         } else {
             $languages_categories = LanguageCategory::where('id_language', $lang->id)->where('id_category', $categoria->id)->first();
             if (isset($languages_categories->id)) {
                 $languages_categories->delete();
             }
         }
     }
 }
开发者ID:serranozafra,项目名称:pruebaHectorSerrano,代码行数:25,代码来源:CategoryController.php


注:本文中的app\Language::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。