Language editor refactoring part 1 (nackend)

This commit is contained in:
Peter Papp
2021-03-27 18:53:41 +01:00
parent cdb395c77f
commit ec51440c3a
25 changed files with 1833 additions and 1677 deletions

View File

@@ -0,0 +1,26 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\ResourceCollection;
class LanguageCollection extends ResourceCollection
{
public $collects = LanguageResource::class;
/**
* Transform the resource collection into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
return [
'data' => $this->collection,
'meta' => [
'current_language' => get_setting('language') ?? 'en',
],
];
}
}