本文整理汇总了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']);
}
示例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);
}
示例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]);
}
示例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]);
}
示例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'));
}
示例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);
}
示例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'));
}
示例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'));
}
示例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);
}
示例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) {
}
}
}
示例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'));
}
示例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]);
}
示例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');
}
示例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'));
}
示例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"]);
}