restore composer.json, add mysqli extension
This commit is contained in:
42
app/Jobs/Dashboard/Currency/Store.php
Executable file
42
app/Jobs/Dashboard/Currency/Store.php
Executable file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Dashboard\Currency;
|
||||
|
||||
use App\Models\Currency;
|
||||
use Illuminate\Support\Arr;
|
||||
use App\Http\Requests\Dashboard\Currency\Store as StoreRequest;
|
||||
|
||||
class Store
|
||||
{
|
||||
|
||||
protected $attr;
|
||||
|
||||
/**
|
||||
* Store constructor.
|
||||
* @param array $attr
|
||||
*/
|
||||
public function __construct(array $attr = [])
|
||||
{
|
||||
$this->attr = Arr::only($attr, ['dollar', 'euro']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param StoreRequest $request
|
||||
* @return Store
|
||||
*/
|
||||
public static function fromRequest(StoreRequest $request)
|
||||
{
|
||||
return new static([
|
||||
'dollar' => $request->getDollar(),
|
||||
'euro' => $request->getEuro()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
Currency::create($this->attr);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user