liberu-accounting / accounting-laravel

Accounting application written in Laravel 11 / PHP 8.3 using Filament 3
https://www.facebook.com/liberusoftware
32 stars 3 forks source link

Sweep: Route not found on first run #39

Open marvoh opened 3 months ago

marvoh commented 3 months ago

This is a bug.

Prerequisites

Description

On setting up the application and running, /admin returns the error

Route [login] not defined.`

I am new to Laravel so the best I could do was look around the net and stumbled across something similar in the Filament issues page here but the proposed solution did not work.

Would you know how to get this to run?

Steps to Reproduce

  1. Build docker container
  2. Check application in browser

Expected behavior

Expecting a login page to be presented

Actual behavior

Route [login] not defined. is the error given

curtisdelicata commented 3 months ago

This will be fixed. If you fix it before we do, please open a pull request.

marvoh commented 3 months ago

I tried /admin and experienced the same issue.

I can try re-install and test again if it works on your end.

Sent from Proton Mail mobile

-------- Original Message -------- On Mar 24, 2024, 22:18, Curtis Delicata wrote:

Actually try /admin

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

sweep-ai[bot] commented 1 month ago

🚀 Here's the PR! #77

💎 Sweep Pro: You have unlimited Sweep issues

Actions

Relevant files (click to expand). Mentioned files will always appear here. https://github.com/liberu-accounting/accounting-laravel/blob/e2c055352c6c330fb8a95ed1c50bb512ef0bb39c/app/Providers/Filament/AdminPanelProvider.php#L1-L60 https://github.com/liberu-accounting/accounting-laravel/blob/e2c055352c6c330fb8a95ed1c50bb512ef0bb39c/app/Http/Middleware/Authenticate.php#L1-L16 https://github.com/liberu-accounting/accounting-laravel/blob/e2c055352c6c330fb8a95ed1c50bb512ef0bb39c/routes/web.php#L1-L17 https://github.com/liberu-accounting/accounting-laravel/blob/e2c055352c6c330fb8a95ed1c50bb512ef0bb39c/app/Filament/Admin/Resources/TenantResource.php#L1-L63

Step 2: ⌨️ Coding

routes/web.php

Add a new route definition for the 'login' route.
<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\LoginController;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::get('/login', [LoginController::class, 'showLoginForm'])->name('login');

app/Http/Controllers/LoginController.php

Create a new `LoginController` to handle the login functionality.
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class LoginController extends Controller
{
    public function showLoginForm()
    {
        return view('auth.login');
    }
}

resources/views/login.blade.php

Create a new Blade template for the login page in the resources/views directory.
@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">{{ __('Login') }}</div>

                <div class="card-body">
                    <form method="POST" action="{{ route('login') }}">
                        @csrf

                        <div class="form-group row">
                            <label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>

                            <div class="col-md-6">
                                <input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>

                                @error('email')
                                    <span class="invalid-feedback" role="alert">
                                        <strong>{{ $message }}</strong>
                                    </span>
                                @enderror
                            </div>
                        </div>

                        <div class="form-group row">
                            <label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>

                            <div class="col-md-6">
                                <input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="current-password">

                                @error('password')
                                    <span class="invalid-feedback" role="alert">
                                        <strong>{{ $message }}</strong>
                                    </span>
                                @enderror
                            </div>
                        </div>

                        <div class="form-group row mb-0">
                            <div class="col-md-8 offset-md-4">
                                <button type="submit" class="btn btn-primary">
                                    {{ __('Login') }}
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

Step 3: 🔄️ Validating

Your changes have been successfully made to the branch sweep/route_not_found_on_first_run. I have validated these changes using a syntax checker and a linter.


[!TIP] To recreate the pull request, edit the issue title or description.

This is an automated message generated by Sweep AI.

curtisdelicata commented 3 weeks ago

Does this still happen when using /admin/login

Soon we will be using Jetstream for auth ans and teams tenancy so that will definitely solve if not already.

curtisdelicata commented 3 weeks ago

@marvoh