Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Last active May 31, 2019 17:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uno-de-piera/981b8c81446a2543e246a0a4e9b42fcf to your computer and use it in GitHub Desktop.
Save uno-de-piera/981b8c81446a2543e246a0a4e9b42fcf to your computer and use it in GitHub Desktop.
<?php
namespace App\Http\Controllers;
use App\Statistic;
class StatisticController extends Controller
{
public function stats() {
$period = request('period');
$statistics = Statistic::select('columns')
->where('Period', $period)
->orderBy('PeriodDate');
$statisticsCurrentYear = clone $statistics; // falla el resultado final
$statisticsPreviousYear = clone $statistics; // falla el resultado final
// más código aquí
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment