本文整理汇总了PHP中app\Language::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Language::all方法的具体用法?PHP Language::all怎么用?PHP Language::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Language
的用法示例。
在下文中一共展示了Language::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCreate
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function getCreate()
{
$languages = Language::all();
$language = "";
// Show the page
return view('admin.objecttype.create_edit', compact('languages', 'language'));
}
示例2: edit
public function edit($id)
{
if (Request::isMethod('get')) {
$roles = UserRole::orderBy('id', 'desc')->get();
$info = User::find($id);
$cats = BlogCategory::where('lang_code', $info->userblog->lang_code)->get();
$langs = Language::all();
return view('admin.users.edit', array('cats' => $cats, 'langs' => $langs, 'info' => $info, 'roles' => $roles));
}
// POST
parse_str(Request::input('data'));
$category_save = implode(',', $category);
$u = User::find($id);
$u->name = $name;
$u->address = $address;
$u->zipcode = $zipcode;
$u->city = $city;
$u->phone = $phone;
$u->cpr = $cpr;
$u->role = $role;
$u->account_number = $account_number;
if ($password != null || $password != '') {
$u->password = Hash::make($password);
}
$u->save();
$info_update = array('blogname' => $blogname, 'domain' => $blogurl, 'lang_code' => $lang_code, 'blog_categories' => $category_save);
UserBlog::where('user_id', $id)->update($info_update);
}
示例3: getEdit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function getEdit($id)
{
$photoalbum = PhotoAlbum::find($id);
$language = $photoalbum->language_id;
$languages = Language::all();
return view('backend.photoalbum.create_edit', compact('photoalbum', 'languages', 'language'));
}
示例4: getEdit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function getEdit($id)
{
$videoalbum = VideoAlbum::find($id);
$language = $videoalbum->language_id;
$languages = Language::all();
return view('admin.videoalbum.create_edit', compact('videoalbum', 'languages', 'language'));
}
示例5: getEdit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function getEdit($id)
{
$newscategory = ArticleCategory::find($id);
$language = $newscategory->language_id;
$languages = Language::all();
return view('backend.newscategory.create_edit', compact('newscategory', 'languages', 'language'));
}
示例6: getLanguages
/**
* JSON data for seeding Languages
* @return \Illuminate\Http\JsonResponse
* @throws \Exception
*/
public function getLanguages()
{
return Datatable::collection(Language::all())->showColumns('title', 'code')->addColumn('updated_at', function ($model) {
return $model->updated_at->diffForHumans();
})->addColumn('', function ($model) {
return get_ops('language', $model->id);
})->searchColumns('title')->orderColumns('title', 'code')->make();
}
示例7: getEdit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function getEdit($id)
{
$news = Article::find($id);
$languages = Language::all();
$language = $news->language_id;
$newscategories = ArticleCategory::all();
$newscategory = $news->newscategory_id;
return view('admin.news.create_edit', compact('news', 'languages', 'language', 'newscategories', 'newscategory'));
}
示例8: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$statusCode = 200;
$response = ['languages' => []];
$languages = Language::all();
foreach ($languages as $language) {
$response['languages'][] = ['id' => $language->id, 'language' => $language->language];
}
return response($response, $statusCode);
}
示例9: search
public function search(Request $request)
{
// retrieve query from URL
$q = $request->q;
// SQL LIKE format for matching on search query:
// %SEARCH_TERM%
$q_query = '%' . $q . '%';
$questions = Question::where('title', 'LIKE', $q_query)->orWhere('description', 'LIKE', $q_query)->orWhere('code', 'LIKE', $q_query)->get();
return view('questions.search', ['q' => $q, 'questions' => $questions, 'languages' => Language::all()]);
}
示例10: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
*
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$city = City::findOrFail($id);
$country = Country::all();
$language = Language::all();
$languages_cur = $city->language;
foreach ($languages_cur as $language_cur) {
$lang[] = $language_cur['id'];
}
return view('editCity', ['id' => $id, 'city' => $city->city, 'country_cur' => $city->country_id, 'languages_cur' => $lang, 'countries' => $country, 'languages' => $language]);
}
示例11: showUserProfile
public function showUserProfile()
{
$user = User::getUserProfile();
$languages = Language::all();
if ($user['status'] != '200') {
return Render::errorPage($user['status']);
}
//if error
$countries = Country::getAll();
return view('backend.user.profile')->with('content_title', 'My Profile')->with('languages', $languages)->with('countries', $countries)->with('user_info', $user['data']['user_info'])->with('user_role', $user['data']['user_role']);
}
示例12: edit
public function edit($id)
{
if (Request::isMethod('get')) {
$lang = Language::all();
$info = BlogCategory::find($id);
return view('admin.blogcategories.edit', array('lang' => $lang, 'info' => $info));
}
$data = Request::all();
$c = BlogCategory::find($id);
$c->name = $data['name'];
$c->lang_code = $data['lang_code'];
$c->save();
return redirect('admin/blog-categories')->with('ok', 'Saved');
}
示例13: create
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create($company_id)
{
$company = Company::find($company_id);
$countries = Country::all();
foreach ($countries as $ctr) {
$country_names[$ctr->id] = $ctr->name;
}
$cities = City::all();
foreach ($cities as $ct) {
$city_names[$ct->id] = $ct->name;
}
foreach (Language::all() as $lang) {
$langs[$lang->id] = $lang->name;
}
return view('jobs.create', compact('country_names', 'city_names', 'langs', 'company'));
}
示例14: index
public function index()
{
if (Request::isMethod('get')) {
$lang = Language::all();
$settings = Setting::all();
return view('admin.settings.index', array('langs' => $lang, 'settings' => $settings));
}
/// POST
$data = Request::all();
$s = new Setting();
$s->name = $data['name'];
$s->lang_code = $data['lang_code'];
$s->value = $data['value'];
$s->type = 'var';
$s->save();
return redirect('admin/settings');
}
示例15: index
/**
* Display list language
* @return Response
*/
public function index()
{
$languages = Language::all();
$filesobj = File::files(base_path() . '/resources/lang/en/');
$files = array();
$count_nhat = 0;
$count_english = 0;
foreach ($filesobj as $key => $value) {
$namefile = basename($value);
$tienganh = File::getRequire(base_path() . '/resources/lang/en/' . $namefile);
$tiengnhat = File::getRequire(base_path() . '/resources/lang/jp/' . $namefile);
foreach ($tienganh as $key => $value) {
$count_english++;
if (array_key_exists($key, $tiengnhat)) {
if ($tiengnhat[$key] != '') {
$count_nhat++;
}
}
}
}
$percent_language = round($count_nhat / $count_english * 100, 0);
return view('language', compact('languages', 'percent_language'));
}