Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=sqlite
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=speedtest_tracker
# DB_USERNAME=
# DB_PASSWORD=

BROADCAST_CONNECTION=log
CACHE_STORE=database
Expand Down
48 changes: 0 additions & 48 deletions .env.testing

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# .github/workflows/tests.yml
name: Tests

on:
push:
branches:
- '!main'
- '!release-**'
pull_request:
workflow_dispatch:

jobs:
lint-app:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: "duster"
uses: tighten/duster-action@v3
with:
args: lint --using=pint -v

test-app:
needs: lint-app
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'

- name: Create SQLite Database
run: |
touch database/testing.sqlite
- name: Install Dependencies
run: |
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
npm ci && npm run build
- name: Copy Environment File
run: cp .env.example .env

- name: Generate App Key
run: php artisan key:generate --quiet

- name: Run Tests
run: php artisan test --parallel
59 changes: 0 additions & 59 deletions .github/workflows/tests.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,21 @@
use App\Models\Result;
use Illuminate\Http\Request;

class HomeController extends Controller
class PagesController extends Controller
{
/**
* Handle the incoming request.
*/
public function __invoke(Request $request)
public function gettingStarted()
{
return view('getting-started');
}

public function home(Request $request)
{
$latestResult = Result::query()
->select(['id', 'ping', 'download', 'upload', 'status', 'created_at'])
->where('status', '=', ResultStatus::Completed)
->latest()
->first();

if (! $latestResult) {
return view('get-started');
}

return view('dashboard', [
'latestResult' => $latestResult,
]);
Expand Down
26 changes: 26 additions & 0 deletions app/Http/Middleware/GettingStarted.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace App\Http\Middleware;

use App\Enums\ResultStatus;
use App\Models\Result;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;

class GettingStarted
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next): Response
{
if (Result::where('status', '=', ResultStatus::Completed)->doesntExist()) {
return redirect()->route('getting-started');
}

return $next($request);
}
}
6 changes: 3 additions & 3 deletions bootstrap/app.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

use App\Http\Middleware\PublicDashboard;
use App\Providers\AppServiceProvider;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
Expand All @@ -16,10 +15,11 @@
)
->withMiddleware(function (Middleware $middleware) {
$middleware->alias([
'public-dashboard' => PublicDashboard::class,
'getting-started' => App\Http\Middleware\GettingStarted::class,
'public-dashboard' => App\Http\Middleware\PublicDashboard::class,
]);

$middleware->redirectGuestsTo(fn () => route('admin/login'));
$middleware->redirectGuestsTo(fn () => route('filament.admin.auth.login'));
$middleware->redirectUsersTo(AppServiceProvider::HOME);

$middleware->trustProxies(at: '*');
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,16 @@
},
"require-dev": {
"fakerphp/faker": "^1.24.1",
"laravel/pail": "^1.2.2",
"laravel/pint": "^1.21.2",
"laravel/sail": "^1.41.0",
"laravel/telescope": "^5.6.0",
"mockery/mockery": "^1.6.12",
"nunomaduro/collision": "^8.7.0",
"phpunit/phpunit": "^11.5.13",
"pestphp/pest": "^3.7.4",
"pestphp/pest-plugin-laravel": "^3.1",
"spatie/laravel-ignition": "^2.9.1",
"tightenco/duster": "^3.1.0",
"laravel/pail": "^1.2.2"
"tightenco/duster": "^3.1.0"
},
"autoload": {
"files": [
Expand Down
Loading