Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Hi-Folks/gh-actions-yaml-generator

331 stars
2 code files
View Hi-Folks/gh-actions-yaml-generator on GitHub

app/Http/Livewire/Dashboard/Daily.php

Open in GitHub
use App\Models\Configuration;
use App\Models\LogConfiguration;
use Illuminate\Support\Facades\DB;
use Livewire\Component;
 
class Daily extends Component
{
public $daily;
 
public function mount(): void
{
$date = DB::raw('DATE(`created_at`) as `date`');
if (config('database.default') === 'pgsql') {
$date = DB::raw("date_trunc('day', created_at) as date");
}
$this->daily = LogConfiguration::select(array(
$date,
DB::raw('count(*) as count')
))
->groupBy('date')
->orderBy('date', 'DESC') // or ASC
->pluck('count', 'date');
}
//
}

resources/views/livewire/dashboard/daily.blade.php

Open in GitHub
// ...
 
<tbody class="bg-white divide-y divide-gray-200">
 
@foreach($daily as $date => $count)
<tr class="">
<x-table.td>
{{ $date }}
</x-table.td>
<x-table.td align="right">
{{ $count }}
</x-table.td>
 
</tr>
@endforeach
</tbody>
 
// ...

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.