You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.3 KiB
51 lines
1.3 KiB
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Entities\Partners\Customer;
|
|
use App\Entities\Partners\Vendor;
|
|
use App\Entities\Projects\Project;
|
|
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
|
use Illuminate\Foundation\Bus\DispatchesJobs;
|
|
use Illuminate\Foundation\Validation\ValidatesRequests;
|
|
use Illuminate\Routing\Controller as BaseController;
|
|
|
|
class Controller extends BaseController
|
|
{
|
|
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
|
|
|
/**
|
|
* Get collection of projects.
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Collection
|
|
*/
|
|
public function getProjectsList()
|
|
{
|
|
return Project::orderBy('name')->pluck('name', 'id');
|
|
}
|
|
|
|
/**
|
|
* Get collection of vendors.
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Collection
|
|
*/
|
|
public function getVendorsList()
|
|
{
|
|
return Vendor::where('is_active', 1)
|
|
->orderBy('name')
|
|
->pluck('name', 'id');
|
|
}
|
|
|
|
/**
|
|
* Get list of customers and vendors.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function getCustomersAndVendorsList()
|
|
{
|
|
return [
|
|
__('customer.customer') => Customer::orderBy('name')->pluck('name', 'id')->all(),
|
|
__('vendor.vendor') => Vendor::orderBy('name')->pluck('name', 'id')->all(),
|
|
];
|
|
}
|
|
}
|