當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。