src/Http/Response/Format/Json.php
public function formatEloquentModel($model)
    {
        $key = Str::singular($model->getTable());

        if (! $model::$snakeAttributes) {
            $key = Str::camel($key);
        }

        return $this->encode([$key => $model->toArray()]);
    }
public function formatEloquentModel($model)
    {
        $key = Str::singular($model->getTable());

        if (! $model::$snakeAttributes) {
            $key = Str::camel($key);
        }

        return $this->encode([$key => $model->toArray()]);
    }
public function formatEloquentModel ( $ model ) { $ key = Str :: singular ( $ model -> getTable ( ) ) ; if ( ! $ model :: $ snakeAttributes ) { $ key = Str :: camel ( $ key ) ; } return $ this -> encode ( [ $ key => $ model -> toArray ( ) ] ) ; }
Format an Eloquent model.

@param \Illuminate\Database\Eloquent\Model $model

@return string
Format an Eloquent model .