- fix users cannot reset password due session expiration - add a new mail when users contacts via Contact form - add list page for all deals in broker dashboard - fixed links in home page
39 lines
990 B
PHP
39 lines
990 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Broker;
|
|
|
|
use App\Actions\GetBrokerStatsAction;
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
class BrokerDashboardController extends Controller
|
|
{
|
|
public function index(GetBrokerStatsAction $getBrokerStatsAction)
|
|
{
|
|
return view('dashboards.broker.index')
|
|
->with('deals', $this->deals())
|
|
->with('stats', $getBrokerStatsAction->execute(Auth::user()));
|
|
}
|
|
|
|
protected function deals()
|
|
{
|
|
return Auth::user()
|
|
->deals()
|
|
->select([
|
|
'id',
|
|
'title',
|
|
'description',
|
|
'image',
|
|
'active',
|
|
'slug',
|
|
'link',
|
|
'deal_category_id',
|
|
])
|
|
->with('category:id,name')
|
|
->WithLikePerDeal()
|
|
->WithRedirectionPerDeal()
|
|
->withViewPerDeal()
|
|
->latest()->take(3)->get();
|
|
}
|
|
}
|