restore composer.json, add mysqli extension
This commit is contained in:
52
app/Http/Controllers/Dashboard/Currency/Controller.php
Executable file
52
app/Http/Controllers/Dashboard/Currency/Controller.php
Executable file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Dashboard\Currency;
|
||||
|
||||
use App\Http\Controllers\Controller as ExController;
|
||||
use App\Models\Currency;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Http\Requests\Dashboard\Currency\Store as StoreRequest;
|
||||
use App\Jobs\Dashboard\Currency\Store as StoreJob;
|
||||
|
||||
class Controller extends ExController
|
||||
{
|
||||
protected $currency;
|
||||
|
||||
/**
|
||||
* Controller constructor.
|
||||
* @param Currency $currency
|
||||
*/
|
||||
public function __construct(Currency $currency)
|
||||
{
|
||||
$this->currency = $currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->authorize('view', 'currencies');
|
||||
$currencies = $this->currency->latest('id')->limit(20)->get();
|
||||
return view('dashboard.currency.index', compact('currencies'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param StoreRequest $request
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||
*/
|
||||
public function store(StoreRequest $request)
|
||||
{
|
||||
if ($request->isMethod('get')) {
|
||||
$this->authorize('create', 'compilations');
|
||||
return view('dashboard.currency.store');
|
||||
}
|
||||
|
||||
$this->dispatchSync(StoreJob::fromRequest($request));
|
||||
$this->success(trans('admin.messages.updated'));
|
||||
|
||||
return redirect()->route('dashboard.currency');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user