Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| ConfigurationRepository | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| storeConfig | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Repository; |
| 4 | |
| 5 | use Illuminate\Support\Facades\Auth; |
| 6 | use Illuminate\Support\Str; |
| 7 | |
| 8 | class ConfigurationRepository |
| 9 | { |
| 10 | public static function storeConfig($table, $data) |
| 11 | { |
| 12 | $data['value'] = ['slug' => Str::slug($data['request']['name']), 'created_by' => Auth::user()->id]; |
| 13 | $data = array_merge($data['value'], $data['request']); |
| 14 | $model = 'App\Models\\' . $table; |
| 15 | |
| 16 | return $model::query()->create($data); |
| 17 | } |
| 18 | } |