Exemplo n.º 1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Group::unguard();
     Group::truncate();
     $groups = [['Admin', 'Admins', '#B72A2A', 'wrench'], ['Guest', 'Guests', null, null], ['Member', 'Members', null, null], ['Mod', 'Mods', '#80349E', 'bolt']];
     foreach ($groups as $group) {
         Group::create(['name_singular' => $group[0], 'name_plural' => $group[1], 'color' => $group[2], 'icon' => $group[3]]);
     }
 }
Exemplo n.º 2
0
 /**
  * Get the groups, ready to be serialized and assigned to the document
  * response.
  *
  * @param \Flarum\Api\JsonApiRequest $request
  * @param \Flarum\Api\JsonApiResponse $response
  * @return \Illuminate\Database\Eloquent\Collection
  */
 protected function data(JsonApiRequest $request, JsonApiResponse $response)
 {
     return Group::get();
 }