35 lines
742 B
PHP
35 lines
742 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Broker;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
class BrokerDashboardController extends Controller
|
|
{
|
|
public function index()
|
|
{
|
|
return view('dashboards.broker.index')
|
|
->with('deals', $this->deals());
|
|
}
|
|
|
|
protected function deals()
|
|
{
|
|
return Auth::user()
|
|
->deals()
|
|
->select([
|
|
'id',
|
|
'title',
|
|
'description',
|
|
'image',
|
|
'active',
|
|
'slug',
|
|
'link',
|
|
'deal_category_id',
|
|
])
|
|
->with('category:id,name')
|
|
->latest()
|
|
->paginate();
|
|
}
|
|
}
|