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


PHP Company::all方法代码示例

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


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

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     //
     $validator = Validator::make($request->all(), ['name' => 'required|unique:papers', 'size' => 'required|unique:papers']);
     if ($validator->fails()) {
         if ($request->ajax()) {
             return response()->json($validator->messages());
             exit;
         } else {
             return \Redirect::back()->withErrors($validator)->withInput();
         }
     }
     array_forget($request, "_token");
     $all_request = $request->all();
     $paper = new Paper();
     foreach ($all_request as $key => $value) {
         $paper->{$key} = $value;
     }
     $paper->save();
     $papers = Paper::all();
     if ($request->ajax()) {
         if ($papers) {
             foreach ($papers as $paper) {
                 echo "\n                        <tr>\n                            <td>{$paper->id}</td>\n                            <td>{$paper->name}</td>\n                            <td>{$paper->description}</td>\n                            <td>{$paper->dimension}</td>\n                            <td>{$paper->unit}</td>\n\n                            <td><button class='edtPaperLink btn-primary' cid='{$paper->id}' cname='{$paper->name}' cdescription='{$paper->description}' cdimension='{$paper->dimension}' cunit='{$paper->unit}'><span  class='glyphicon glyphicon-pencil'></span></button></td>\n                            <td><button class='btn-danger'  data-target='#myModalPaperEdit' data-toggle='modal'><span  class='glyphicon glyphicon-trash'></span></button></td>\n                        </tr>\n                        ";
             }
         }
         exit;
     }
     return View("settings.paper", ["companies" => Company::all(), 'papers' => $papers, 'title' => 'Job Papers Setting']);
 }
开发者ID:runningjack,项目名称:lexmark2,代码行数:36,代码来源:PaperController.php

示例2: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $dataView = array();
     $dataView['page_title'] = "Compañías";
     $dataView['companies'] = Company::all();
     return view('company.index', $dataView);
 }
开发者ID:lautaruni,项目名称:billboard,代码行数:12,代码来源:CompanyController.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     $companies = Company::all();
     $accountancies = Accountancy::all();
     return view('admin.accountancy.index')->with(['companies' => $companies, 'accountancies' => $accountancies]);
 }
开发者ID:karpuzkan,项目名称:laravel,代码行数:12,代码来源:AccountancyController.php

示例4: edit

 public function edit($id)
 {
     $userName = Auth::user()->name;
     $companies = Company::all();
     $campain = Campain::find($id);
     return view('campain.edit', ['userName' => $userName, 'companies' => $companies, 'campain' => $campain]);
 }
开发者ID:patualeja,项目名称:TESIS,代码行数:7,代码来源:CampainController.php

示例5: showSettings

 public function showSettings()
 {
     $companies = \App\Company::all()->lists('name', 'id');
     $current_company = \App\Company::find(Auth::user()->current_company);
     //        dd($current_company);
     return view('settings.settings', compact('companies', 'current_company'));
 }
开发者ID:johanWP,项目名称:pandora,代码行数:7,代码来源:SettingsController.php

示例6: index

 public function index()
 {
     $data['is_showzhiye'] = Zhiye::where('z_show', '=', '1')->get();
     $data['allzhiye'] = Zhiye::all();
     $data['is_showcompany'] = Company::where('c_show', '=', '1')->get();
     $data['allcompany'] = Company::all();
     $data['alltime'] = Time::all();
     return view('contestRoom.index', $data);
 }
开发者ID:Greasi,项目名称:yizu,代码行数:9,代码来源:ContestRoomController.php

示例7: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (Auth::user()->hasRole('member')) {
         $companies = Company::where('comUserId', '=', Auth::user()->id)->get();
     } else {
         $companies = Company::all()->sortBy('comName');
     }
     return view('company.index', compact('companies'));
 }
开发者ID:e11en,项目名称:allocatie,代码行数:14,代码来源:CompanyController.php

示例8: index

 function index()
 {
     $user = Auth::user();
     $posts = Post::latest('id')->get();
     $companies = Company::all();
     $users = User::all();
     $testvar = "XYZABC";
     return view('users.test', compact('testvar'));
     return view('users.index', compact('user', 'posts', 'companies', 'users'));
 }
开发者ID:Kishimotovn,项目名称:IMS_Laravel,代码行数:10,代码来源:UserController.php

示例9: create

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $query = Company::all('id', 'name')->toArray();
     // TODO: Rework this to be more efficient. Could probably be done in a
     // shorter way.
     $companies = [];
     foreach ($query as $row) {
         $companies[$row['id']] = $row['name'];
     }
     return view('expenses/create')->with('companies', $companies);
 }
开发者ID:taylordaughtry,项目名称:WeeklyWorth,代码行数:16,代码来源:ExpensesController.php

示例10: run

 public function run()
 {
     $contacts = \App\Contact::all();
     $companies = \App\Company::all();
     for ($i = 0; $i < 20; $i++) {
         try {
             $contacts->random()->companies()->attach($companies->random());
         } catch (\Exception $e) {
         }
     }
 }
开发者ID:ntamvl,项目名称:admin-3-demo,代码行数:11,代码来源:CompanyContactSeeder.php

示例11: create

 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     $products = Product::all();
     $weeknrs = getWeeknumbers();
     if (Auth::user()->hasRole('member')) {
         $companies = Company::where('comUserId', '=', Auth::user()->id)->get();
     } else {
         $companies = Company::all();
     }
     $providers = Provider::all();
     return view('allocatie.create', compact('products', 'companies', 'weeknrs', 'providers'));
 }
开发者ID:e11en,项目名称:allocatie,代码行数:17,代码来源:AllocatieController.php

示例12: companies

 public function companies()
 {
     $userName = Auth::user()->name;
     $companies = Company::all();
     $results = [];
     foreach ($companies as $company) {
         $company_id = $company->id;
         $campains = DB::table('campains')->where('company_id', '=', $company_id)->get();
         $totalGain = 0;
         $totalInvestment = 1;
         foreach ($campains as $campain) {
             $totalGain = $totalGain + $campain->gain;
             $totalInvestment = $totalInvestment + $campain->cost;
         }
         $roi = ($totalGain - $totalInvestment) / $totalInvestment;
         $roi = number_format($roi, 2);
         $results[] = ["name" => $company->name, "roi" => $roi];
     }
     return view('report.companies', ['userName' => $userName, 'results' => $results]);
 }
开发者ID:patualeja,项目名称:TESIS,代码行数:20,代码来源:ReportController.php

示例13: months

 public function months($months)
 {
     Excel::create('通讯报销汇总_' . $months, function ($excel) use($months) {
         $companies = Company::all();
         foreach ($companies as $company) {
             $excel->sheet('new Sheet', function ($sheet) use($company, $months) {
                 $sheet->setAllBorders('thin');
                 // Set border for cells
                 $sheet->setBorder('A1', 'thin');
                 // Font family
                 $sheet->setFontFamily('Comic Sans MS');
                 // Set font with ->setStyle()`
                 $sheet->setStyle(array('font' => array('name' => 'Calibri', 'size' => 11, 'bold' => false)));
                 $sum = \App\MobileFees::where('company_id', $company->id)->where('months', $months)->with('company', 'employee')->sum('fee');
                 $mobilefees = \App\MobileFees::where('company_id', $company->id)->where('months', $months)->with('company', 'employee')->get();
                 $sheet->loadView('report.index')->with('mobilefees', $mobilefees)->with('sum', $sum)->with('company_name', $company->name);
             });
         }
     })->download('xls');
 }
开发者ID:sunhuang2015,项目名称:mytask,代码行数:20,代码来源:ExcelExportController.php

示例14: createexhibitorbyadmin

 /**
  * create exhibitor by admin
  * 
  * @return Response
  */
 public function createexhibitorbyadmin()
 {
     $countries = Country::all();
     $companies = Company::all();
     return view('AdminCP.exhibitors.create', compact('countries', 'companies'));
 }
开发者ID:raniafathy,项目名称:wavexpo,代码行数:11,代码来源:ExhibitorsController.php

示例15: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     //
     return View("administrators.edituser", ["companies" => Company::all(), "myuser" => User::find($id), "myrole" => \DB::table("role_user")->where("user_id", $id)->get(), "roles" => \DB::table("roles")->get(), "title" => "Edit User"]);
 }
开发者ID:runningjack,项目名称:lexmark2,代码行数:11,代码来源:UserController.php


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