mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#557 Installment calculation widget
This commit is contained in:
parent
af20bc8cb3
commit
e647124f0f
@ -47,6 +47,8 @@
|
||||
{{ blocks('ad-item-content-block-area') }}
|
||||
{% endif %}
|
||||
|
||||
{{ addBlock('ad-detail/widget', {'price': adv.price, 'id': adv.id})|raw }}
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
@ -207,6 +207,11 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
|
||||
'as' => 'ajax::getAds',
|
||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\AjaxController@getMyAds'
|
||||
],
|
||||
|
||||
'ajax/loanApplication' => [
|
||||
'as' => 'ajax::loanApplication',
|
||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\AjaxController@sendLoanApplication'
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php namespace Visiosoft\AdvsModule\Http\Controller;
|
||||
|
||||
use Anomaly\Streams\Platform\Http\Controller\PublicController;
|
||||
use Anomaly\UsersModule\User\UserModel;
|
||||
use Visiosoft\AdvsModule\Adv\AdvModel;
|
||||
use Illuminate\Http\Request;
|
||||
use Visiosoft\AdvsModule\Adv\Contract\AdvRepositoryInterface;
|
||||
@ -9,14 +10,17 @@ use Visiosoft\LocationModule\District\DistrictModel;
|
||||
use Visiosoft\LocationModule\Neighborhood\NeighborhoodModel;
|
||||
use Visiosoft\LocationModule\Village\VillageModel;
|
||||
use Visiosoft\CatsModule\Category\CategoryModel;
|
||||
use Visiosoft\NotificationsModule\Notify\Notification\SendLoanApplicationMail;
|
||||
|
||||
class AjaxController extends PublicController
|
||||
{
|
||||
private $adv_model;
|
||||
private $userModel;
|
||||
|
||||
public function __construct(AdvModel $advModel)
|
||||
public function __construct(AdvModel $advModel, UserModel $userModel)
|
||||
{
|
||||
$this->adv_model = $advModel;
|
||||
$this->userModel = $userModel;
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
@ -88,4 +92,10 @@ class AjaxController extends PublicController
|
||||
return response()->json(['success' => true, 'content' => $my_advs, 'title' => $page_title]);
|
||||
}
|
||||
|
||||
public function sendLoanApplication(Request $request)
|
||||
{
|
||||
$this->userModel->find(1)->notify(new SendLoanApplicationMail($request));
|
||||
return response()->json(['success' => true, 'content' => $request['firstName']]);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user