本文整理汇总了PHP中app\Client::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::all方法的具体用法?PHP Client::all怎么用?PHP Client::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Client
的用法示例。
在下文中一共展示了Client::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
public function edit($id)
{
$access = Access::findOrFail($id);
$client = Client::all()->lists('name', 'id');
$selected = array();
return view('access.edit', compact('access', 'client', 'selected'));
}
示例2: index
/**
* Show the application dashboard.
*
* @return Response
*/
public function index()
{
$clients = Client::all();
$projects = Project::all();
$notes = ClientNote::all();
return view('home')->with('clientCount', count($clients))->with('projectCount', count($projects))->with('noteCount', count($notes));
}
示例3: index
public function index()
{
if (Auth::user()['role'] == 'Accounting' or Auth::user()['role'] == 'General Manager') {
$clients = Client::all();
$overdue = new SalesInvoice();
$delivered = new SalesInvoice();
$check = new SalesInvoice();
$salesinvoice = new SalesInvoice();
$salesinvoice2 = new SalesInvoice();
$salesinvoice3 = new SalesInvoice();
$salesinvoiceTotal;
foreach ($clients as $client) {
$overdue[$client->id] = SalesInvoice::where('client_id', $client->id)->where('status', 'Overdue')->count();
$delivered[$client->id] = SalesInvoice::where('client_id', $client->id)->where('status', 'Delivered')->count();
$check[$client->id] = SalesInvoice::where('client_id', $client->id)->where('status', 'Check on Hand')->count();
// $salesinvoice[$client->id] = DB::SELECT("SELECT sum(total_amount) as total FROM sales_invoices
// WHERE (status = 'Overdue' or status = 'Delivered') and client_id = '$client->id'");
$salesinvoice = SalesInvoice::where('status', '=', 'Overdue')->where('client_id', '=', $client->id)->sum('total_amount');
$salesinvoice2 = SalesInvoice::where('status', 'Delivered')->where('client_id', $client->id)->sum('total_amount');
$salesinvoice3 = SalesInvoice::where('status', 'Check on Hand')->where('client_id', $client->id)->sum('total_amount');
$salesinvoiceTotal[$client->id] = $salesinvoice + $salesinvoice2 + $salesinvoice3;
//$salesinvoice[$client->id] = SalesInvoice::where('status = Overdue or status = Delivered and client_id = '.$client->id.'')->sum('total_amount');
}
// for ($x = 1; $x < count($clients)+1; $x++)
// {
// $overdue[$x] = SalesInvoice::where('client_id', $x)->where('status', 'Overdue')->count();
// $delivered[$x] = SalesInvoice::where('client_id', $x)->where('status', 'Delivered')->count();
// $pending[$x] = SalesInvoice::where('client_id', $x)->where('status', 'Pending')->count();
// }
return view('collectibles.index', compact('clients', 'overdue', 'delivered', 'check', 'salesinvoiceTotal'));
}
}
示例4: destroy
public function destroy($id)
{
$client = Client::find($id);
$client->delete();
$clients = Client::all();
return view('client.list')->with(['success' => 'Cliente excluído com sucesso!', 'clients' => $clients]);
}
示例5: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
if (Gate::denies('viewClients', new Client())) {
abort(403, 'Not allowed');
}
$clients = Client::all();
return View::make('client.index')->with('clients', $clients);
}
示例6: index
public function index(Request $request)
{
if ($request->ajax()) {
$handler = Input::get('handler');
if ($handler == 0) {
$clients = Client::all();
} elseif ($handler == 1) {
$clients = Client::where('active', true)->get();
} else {
$clients = Client::where('active', false)->get();
}
return view('clients.table', ['clients' => $clients]);
} else {
$clients = Client::all();
return view('clients.index', ['clients' => $clients]);
}
}
示例7: create
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create(Request $request, $project_id = null)
{
if ($project_id != null) {
$project = Project::find($project_id);
// Get all clients for dropdown
$clients = Client::all();
} else {
$this->sys_notifications[] = array('type' => 'danger', 'message' => '<i class="fa fa-warning"></i> Projeto não informado!');
$request->session()->flash('sys_notifications', $this->sys_notifications);
return back()->withInput($request->all());
}
if ($request->ajax()) {
return view('project_stages.create-modal', compact('project', $project));
} else {
return view('project_stages.create', compact('project', $project));
}
}
示例8: index
public function index(Request $request)
{
$sort = Input::get('sort') == null ? 'relation_id' : Input::get('sort');
$client_id_select = Input::get('client_id_select') == null ? 'all' : Input::get('client_id_select');
$countCongestion = Input::get('count_congestion') == null ? 'balance_owed' : Input::get('count_congestion');
$sortDirection = Input::get('sortDirection') == null ? 'DESC' : Input::get('sortDirection');
$clients = Client::all();
$debtors = Debtor::all();
$limits = Limit::whereHas('relation', function ($query) use($client_id_select) {
if ($client_id_select !== 'all') {
$query->where('client_id', '=', $client_id_select);
}
})->get();
$usedLimit = array();
foreach ($limits as $key => $limit) {
$usedLimitItem = 0;
foreach ($limit->relation->deliveries as $value) {
if ($value->status == 'Профинансирована') {
if ($countCongestion == 'remainder_of_the_debt_first_payment') {
$usedLimitItem += $value->remainder_of_the_debt_first_payment;
} else {
$usedLimitItem += $value->balance_owed;
}
}
}
$usedLimit[$key] = $usedLimitItem;
}
$relations = Relation::select('client_id')->distinct()->get();
if ($request->ajax()) {
if ($sort == 'client_id') {
return view('limits.indexAjaxClient', ['clients' => $clients, 'countCongestion' => $countCongestion]);
} else {
if ($sort == 'debtor_id') {
return view('limits.indexAjaxDebtor', ['countCongestion' => $countCongestion, 'debtors' => $debtors]);
} else {
return view('limits.indexAjax', ['limits' => $limits, 'relations' => $relations, 'usedLimit' => $usedLimit]);
}
}
} else {
return view('limits.index', ['limits' => $limits, 'relations' => $relations, 'usedLimit' => $usedLimit, 'clients' => $clients]);
}
}
示例9: client
/**
* Display a list of Client's name
* @return static
*/
public function client()
{
return Client::all()->lists('name', 'name')->sort();
}
示例10: index
public function index()
{
$clients = Client::all();
$leftmenu['client'] = 'active';
return view('/clients/clients', ['clients' => $clients, 'leftmenu' => $leftmenu]);
}
示例11: show
/**
* Display the specified resource.
* Last updated by smartrahat Date: 29.11.2015 Time: 05:51PM
* @param int $id
* @return Response
*/
public function show($id)
{
$title = 'SHOW VEHICLE';
$vehicle = Vehicles::findOrFail($id);
$client = Client::all()->where('id', $vehicle->cid)->sortByDesc('updated_at')->first();
$driver = Employee::all()->where('id', $vehicle->eid)->sortByDesc('updated_at')->first();
$fitness = Log::all()->where('action', 'Fitness Check')->where('bid', $vehicle->id)->last();
$police = Log::all()->where('action', 'Police Case')->where('bid', $vehicle->id)->sortByDesc('updated_at')->count();
$accident = Log::all()->where('action', 'Accident')->where('bid', $vehicle->id)->sortByDesc('updated_at')->count();
//dd($accident);
$repository = $this->repository;
return view('vehicle.show', compact('title', 'vehicle', 'driver', 'client', 'status', 'repository', 'fitness', 'police', 'accident'));
}
示例12: getRegistrar
public function getRegistrar()
{
$clientes = Client::all();
return view('cliente.clientes', ['clientes' => $clientes]);
}
示例13: seed
public function seed(Request $request)
{
if ($request->ajax()) {
if ($request->q) {
$clients = Client::where('firm_name', 'LIKE', '%' . $request->q . '%')->orwhere('last_name', 'LIKE', '%' . $request->q . '%')->get();
} else {
$clients = Client::all();
}
$list = array();
foreach ($clients as $key => $value) {
$list[$key]['id'] = $value->id;
$list[$key]['text'] = '#' . $value->id . ' ' . $value->last_name . ' - ' . strtoupper($value->firm_name);
}
return $list;
}
// return Client::select('id', \DB::raw('CONCAT(firm_name, " ", first_name, " ", last_name) as full_name'))->pluck('full_name', 'id');
}
示例14: index
public function index()
{
// \Auth::user()->name; //get name of Auth user
$clients = Client::all();
return view('clients.index', compact('clients', 'client'));
}
示例15: index
/**
* Display a listing of the resource.Andrei111111
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$clients = Client::all();
return view('clients.index', ['clients' => $clients, 'count' => Client::count()]);
}