Skip to content

Commit

Permalink
Merge pull request #43 from Hi-Folks/develop
Browse files Browse the repository at this point in the history
v0.2.2
  • Loading branch information
roberto-butti authored Mar 7, 2021
2 parents 150e3b9 + 0379c78 commit ea5d706
Show file tree
Hide file tree
Showing 20 changed files with 1,385 additions and 785 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ public/js/app.js
public/mix-manifest.json
/.env.prod
/Makefile.param.prod
/public/google*.html
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# Changelog

## 0.2.2 - 2021-03-07
### Add
- All Hashcode configurations are logged into log_configurations table;
- Dashboard: Show the total configurations created daily;
- Add About page with /about URL.

### Change
- Dashboard: sort latest configurations by updated_at.

## 0.2.1 - 2021-02-26
### Add
- Add API for listing configurations
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ cd gh-actions-yaml-generator
cp .env.example .env
composer install
php artisan key:generate
npm i
npm run production
```
Then create your database and update the .env file with the right values for DB_* .

Once your Database is configured you can execute the migrations:
```shell
php artisan migrate
```
Start development server
```shell
Expand Down
10 changes: 10 additions & 0 deletions app/Http/Controllers/ConfiguratorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,14 @@ public function index()
execute Browser, Functional, and Unit tests…";
return view('configurator.index', $data);
}

public function about()
{
$data = [];
$data["title"] = "Generate GitHub Actions Config for Laravel Projects with Ghygen";
$data["description"] = "Setup Database Service, use multiple PHP version,
use multiple Laravel versions, build frontend, cache packages,
execute Browser, Functional, and Unit tests…";
return view('configurator.about', $data);
}
}
28 changes: 28 additions & 0 deletions app/Http/Livewire/Dashboard/Daily.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace App\Http\Livewire\Dashboard;

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()
{
$this->daily = LogConfiguration::select(array(
DB::raw('DATE(`created_at`) as `date`'),
DB::raw('count(*) as `count`')
))
->groupBy('date')
->orderBy('date', 'DESC') // or ASC
->pluck('count', 'date');
}
public function render()
{
return view('livewire.dashboard.daily');
}
}
2 changes: 1 addition & 1 deletion app/Http/Livewire/Dashboard/Latest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Latest extends Component

public function mount()
{
$this->latest = Configuration::latest()->take(5)->get();
$this->latest = Configuration::latest("updated_at")->take(5)->get();
}
public function render()
{
Expand Down
4 changes: 4 additions & 0 deletions app/Models/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,9 @@ public static function saveConfiguration($code, $json, $metadata = "{}")
$confModel->counts = $confModel->counts + 1;

$confModel->save();

LogConfiguration::create([
'code' => $code,
]);
}
}
13 changes: 13 additions & 0 deletions app/Models/LogConfiguration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class LogConfiguration extends Model
{
use HasFactory;

protected $fillable = ['code'];
}
Loading

0 comments on commit ea5d706

Please sign in to comment.