Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Last active May 31, 2019 17:32
Show Gist options
  • Save uno-de-piera/89f8345aebced70e90918f4d2b5ba8db to your computer and use it in GitHub Desktop.
Save uno-de-piera/89f8345aebced70e90918f4d2b5ba8db 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 = with(clone $statistics); // falla el resultado final
$statisticsPreviousYear = with(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