Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Joeseph Chen's avatar

I will try it as soon as i get back to my office, and will post the result back @cronix but as @sinnbeck mention..the problem is on /finances route not the /profile route

Cronix's avatar

True, but he would have the same problem where I mentioned. The route order is important.

The GET users/profile/{user}/edit request would be picked up by the GET users/profile/{user} route.

Sinnbeck's avatar

In that case a better candidate might be this route

Route::get('users/{user}/edit', 'UserController@edit')->name('users.edit');
Joeseph Chen's avatar
Route::group(['middleware' => ['auth']], function () {
    Route::get('users', 'UserController@index')->name('users.index');
    Route::get('users/create', 'UserController@create')->name('users.create');
    Route::get('users/{user}/edit', 'UserController@edit')->name('users.edit');
    Route::post('register', 'Auth\RegisterController@register')->name('register');
    Route::post('users/{user}', 'UserController@assignTeam')->name('users.team');
    Route::put('users/{user}', 'UserController@update')->name('users.update');
    Route::delete('users/{user}', 'UserController@destroy')->name('users.destroy');

    Route::get('users/profile/{user}', 'ProfileController@index')->name('profile');
    Route::get('users/profile/create', 'ProfileController@create')->name('profile.create');
    Route::get('users/profile/{user}/edit', 'ProfileController@edit')->name('profile.edit');
    Route::post('users/profile/', 'ProfileController@store')->name('profile.store');
    Route::put('users/profile/{user}', 'ProfileController@update')->name('profile.update');

    Route::get('users/finances/create', 'UserFinancialController@create')->name('userfinancial.create');
    Route::get('users/finances/{finance}/edit', 'UserFinancialController@edit')->name('userfinancial.edit');
    Route::post('users/finances', 'UserFinancialController@store')->name('userfinancial.store');
    Route::put('users/finances/{finance}', 'UserFinancialController@update')->name('userfinancial.update');
}

I have changed my route like the above, but still yield the 404 page..

but if you mention about the GET users/profile/{user}/edit and the GET users/profile/{user} pattern, both of them is working fine as it should be, but only the finance route get this error

Sinnbeck's avatar

Any chance that there is a folder called financial inside the public directory?

Joeseph Chen's avatar

nope, double check on that also, it is in my resources/views/users/financial/edit.blade.php

and also it isn't the problem with the view file, because when i hit the edit button, it doesn't even reach my controller method, or worse doesn't even read the route file..

because I already tried to dd() on my controller method, and even try change the route on web.php to

Route::get('users/finances/{finance}/edit', function() {
    dd("It's work");
});

but still it just yield a 404 page :( that's why I thought it's a bug

Nakov's avatar

@dycoda and what about sharing full controller code and full view?

Sinnbeck's avatar

Does it work if you change the route slightly? (removed an s)

Route::get('users/finance/{finance}/edit', function() {
    dd("It's work");
});
Joeseph Chen's avatar

It still return the 404 page @sinnbeck

fyi, I get a different result when I change the button url to using a route.

<a href="{{ route('userfinancial.edit', $finance->id)">{{ __('Edit') }}</a>

it return ignition error said that my route not defined or not found. But the error returned from the profile view. Because the button is on the profile view. And if I change the button url to /users/finances/{finance}/edit the profile view is displaying normally, but when I click the edit button, it hits the current problem.

Joeseph Chen's avatar

@nakov I'm unable to share the full controller right now as I'm not on my pc, well it's like around 2.29 AM here :D

Sinnbeck's avatar

You have tried just going to the url manually right? Also can you try moving it to the very top of web.php

Nakov's avatar

@dycoda how do you test the routes then if you are not on the computer :)

Anyhow get some sleep it will be resolved in the morning :)

1 like
Joeseph Chen's avatar

@sinnbeck yeah, tried to manually write the url in the address bar of the browser, but still the same error.

well I will try it first and post back the result..

Joeseph Chen's avatar

well I just left the office when I read your reply @nakov lol thanks, I think I really need some rest, hopefully I can back with a fresh mind and find the error :D

ismaile's avatar

Here are various things you could try one at a time:

  • Manually delete routes.php in the folder bootstrap/cache
  • Move
Route::get('users/finances/{finance}/edit', 'UserFinancialController@edit')->name('userfinancial.edit');

at the top of web.php, just to check if your problem comes from any interference with other routes.

  • Make sure your model UserFinance doesn't have any getRouteKeyName defined since you use the id for route model binding.

Hope this helps.

Snapey's avatar

If route helper says there is no named route of userfinancial.edit then everything else is irrelevant

You need to focus on the output of php artisan route:list and check all your routes and route names for conflicts and to check that this route name exists.

jlrdw's avatar

Also while checking, do a quick dd in controller as you go to ensure you are actually hitting the controller, which means route is working.

And remember to shift routes with more parameters down where needed. As this same issue has happened many times.

Joeseph Chen's avatar

@snapey I have checked my php artisan route:list but doesn't find anything strange, and userfinancial.edit error shows up if I change my button using route(), but if I change it to url /users/finances/{{$finance->id}}/edit, then it return 404 when i hit the edit button.

here is my route list

| GET|HEAD  | users                         | users.index          | App\Http\Controllers\UserController@index               | 
| GET|HEAD  | users/create                  | users.create         | App\Http\Controllers\UserController@create              
| POST           | users/finances                | userfinancial.store  | App\Http\Controllers\UserFinancialController@store      
| GET|HEAD  | users/finances/create         | userfinancial.create | App\Http\Controllers\UserFinancialController@create     
| PUT       | users/finances/{finance}      | userfinancial.update | App\Http\Controllers\UserFinancialController@update     
| GET|HEAD  | users/finances/{finance}/edit | userfinancial.edit   | App\Http\Controllers\UserFinancialController@edit       
| POST      | users/profile/{user}          | profile.store        | App\Http\Controllers\ProfileController@store            | 
| PUT       | users/profile/{user}          | profile.update       | App\Http\Controllers\ProfileController@update           
| GET|HEAD  | users/profile/{user}          | profile              | App\Http\Controllers\ProfileController@index            | 
| GET|HEAD  | users/profile/{user}/create   | profile.create       | App\Http\Controllers\ProfileController@create           
| GET|HEAD  | users/profile/{user}/edit     | profile.edit         | App\Http\Controllers\ProfileController@edit             
| DELETE    | users/{user}                  | users.destroy        | App\Http\Controllers\UserController@destroy             | 
| PUT       | users/{user}                  | users.update         | App\Http\Controllers\UserController@update                    
| POST      | users/{user}                  | users.team           | App\Http\Controllers\UserController@assignTeam          
| GET|HEAD  | users/{user}/edit             | users.edit           | App\Http\Controllers\UserController@edit                
Joeseph Chen's avatar

@ismaile I'm trying to find the routes.php file that you mention, but not found it. So I think there is no cached routes yet since I have tried to clear my route cache from console.

Also tried to move the problematic routes to the top as you and @sinnbeck suggesting me, but still 404, and also double check my model for getRouteKeyName, I'm 100% sure I'm not using it.

Sinnbeck's avatar

Any chance that you have more route files ? Check RouteServiceProvider for the map() method. Does it have more than this?

public function map()
    {
        $this->mapApiRoutes();
        $this->mapWebRoutes();
    }
Joeseph Chen's avatar

Here is my route list

Route::group(['middleware' => ['auth']], function () {
Route::get('users', 'UserController@index')->name('users.index');
    Route::get('users/create', 'UserController@create')->name('users.create');
    Route::get('users/{user}/edit', 'UserController@edit')->name('users.edit');
    Route::post('register', 'Auth\RegisterController@register')->name('register');
    Route::post('users/{user}', 'UserController@assignTeam')->name('users.team');
    Route::put('users/{user}', 'UserController@update')->name('users.update');
    Route::delete('users/{user}', 'UserController@destroy')->name('users.destroy');

    Route::get('users/profile/{user}', 'ProfileController@index')->name('profile');
    Route::get('users/profile/{user}/create', 'ProfileController@create')->name('profile.create');
    Route::get('users/profile/{user}/edit', 'ProfileController@edit')->name('profile.edit');
    Route::post('users/profile/{user}', 'ProfileController@store')->name('profile.store');
    Route::put('users/profile/{user}', 'ProfileController@update')->name('profile.update');

    Route::get('users/finances/create', 'UserFinancialController@create')->name('userfinancial.create');
    Route::get('users/finances/{finance}/edit', 'UserFinancialController@edit')->name('userfinancial.edit');
    Route::post('users/finances', 'UserFinancialController@store')->name('userfinancial.store');
    Route::put('users/finances/{finance}', 'UserFinancialController@update')->name('userfinancial.update');
}

should I move the financial route above the profile route?

I have tried to dd() on my controller method, but it seems that it never hits the controller at all, even tried using the dd() on the callback on route file just to make sure, but still returns me 404, it doesn't even reach the route file.

Joeseph Chen's avatar

Nope, never touch that file before.. @sinnbeck

<?php

namespace App\Providers;

use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Route;

class RouteServiceProvider extends ServiceProvider
{
    /**
     * This namespace is applied to your controller routes.
     *
     * In addition, it is set as the URL generator's root namespace.
     *
     * @var string
     */
    protected $namespace = 'App\Http\Controllers';

    /**
     * Define your route model bindings, pattern filters, etc.
     *
     * @return void
     */
    public function boot()
    {
        //

        parent::boot();
    }

    /**
     * Define the routes for the application.
     *
     * @return void
     */
    public function map()
    {
        $this->mapApiRoutes();

        $this->mapWebRoutes();

        //
    }

    /**
     * Define the "web" routes for the application.
     *
     * These routes all receive session state, CSRF protection, etc.
     *
     * @return void
     */
    protected function mapWebRoutes()
    {
        Route::middleware('web')
             ->namespace($this->namespace)
             ->group(base_path('routes/web.php'));
    }

    /**
     * Define the "api" routes for the application.
     *
     * These routes are typically stateless.
     *
     * @return void
     */
    protected function mapApiRoutes()
    {
        Route::prefix('api')
             ->middleware('api')
             ->namespace($this->namespace)
             ->group(base_path('routes/api.php'));
    }
}

Sinnbeck's avatar

I dont suppose that you can try it on another computer? Or that it is on github, so we can see the code?

ismaile's avatar

Could you modify mapWebRoutes in RouteServiceProvider like the following and let us know about the outcome ?

protected function mapWebRoutes()
    {
        Route::get('users/finances/{finance}/edit', 'UserFinancialController@edit')->name('userfinancial.edit');

        Route::middleware('web')
             ->namespace($this->namespace)
             ->group(base_path('routes/web.php'));
    }
Joeseph Chen's avatar

Here is my whole web.php

Route::group(['middleware' => ['auth']], function () {
        Route::get('/', 'DashboardController@index')->name('dashboard');
        Route::post('/', 'DashboardController@index');

        Route::get('users', 'UserController@index')->name('users.index');
        Route::get('users/create', 'UserController@create')->name('users.create');
        Route::get('users/{user}/edit', 'UserController@edit')->name('users.edit');
        Route::post('register', 'Auth\RegisterController@register')->name('register');
        Route::post('users/{user}', 'UserController@assignTeam')->name('users.team');
        Route::put('users/{user}', 'UserController@update')->name('users.update');
        Route::delete('users/{user}', 'UserController@destroy')->name('users.destroy');

        Route::get('users/profile/{user}', 'ProfileController@index')->name('profile');
        Route::get('users/profile/{user}/create', 'ProfileController@create')->name('profile.create');
        Route::get('users/profile/{user}/edit', 'ProfileController@edit')->name('profile.edit');
        Route::post('users/profile/{user}', 'ProfileController@store')->name('profile.store');
        Route::put('users/profile/{user}', 'ProfileController@update')->name('profile.update');

        Route::get('users/finances/create', 'UserFinancialController@create')->name('userfinancial.create');
        Route::get('users/finances/{finance}/edit', 'UserFinancialController@edit')->name('userfinancial.edit');

        Route::post('users/finances', 'UserFinancialController@store')->name('userfinancial.store');
        Route::put('users/finances/{finance}', 'UserFinancialController@update')->name('userfinancial.update');
});

and the app\http\controllers\UserFinancialController.php

<?php

namespace App\Http\Controllers;

use App\UserFinance;
use App\User;
use Carbon\Carbon;
use Illuminate\Http\Request;

class UserFinancialController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        //
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create(User $user)
    {
        return view('users.financial.create', compact('user'));
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(User $user, Request $request)
    {
            $date = Carbon::now();
            $data = $user->finances()->latest();
            if ($request->month - 1 == 0) {
                $currentData = $data->where('year', $date->subYear()->year)->where('month', $request->month + 11);
            } else {
                $currentData = $data->where('year', $date->year)->where('month', $request->month - 1);
            }

            $currentMistake = $currentData->value('current_mistake');
            $currentLoan = $currentData->value('current_loan');
            $currentSaving = $currentData->value('current_saving');

            $finance = new UserFinance;
            $finance->user_id = $user->id;
            $finance->month = $request->month;
            $finance->year = $request->year;
            $finance->salaries = $request->salaries;
            $finance->bonus = $request->bonus;

            $finance->current_loan = ($currentLoan + $request->loan) - $request->paid_loan;
            $finance->loan = $request->loan;
            $finance->paid_loan = $request->paid_loan;

            $finance->convert_usd = $request->convert_usd;

            $finance->current_saving = ($currentSaving + $request->saving) - $request->taken_saving;
            $finance->saving = $request->saving;
            $finance->taken_saving = $request->taken_saving;

            $finance->total = (($request->salaries + $request->bonus + $request->taken_saving) - ($request->saving - $request->loan)) + ($request->paid_mistake + $request->paid_loan + $request->convert_usd);

            $finance->save();

            notify()->success("Added new journal record for {$user->name}");

            return redirect()->route('profile', $user->id);
    }

    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit(UserFinance $finance)
    {
        return view('users.financial.edit', compact('finance'));
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(User $user, $id, Request $request)
    {
        //
    }
}

and the view file resources/views/users/profile.blade.php

@extends('layouts.app', ['title' => "{$user->name} Profile", 'activePage' => 'users'])

@section('content')

<div class="container-fluid h-100 pr-0">
    <div class="row flex-wrap">
        <div class="col-12">
            <div class="card-header d-flex justify-content-between align-items-center">
                <div>
                    <h2>{{ $user->name }} Profiles</h2>
                </div>

                @if (auth()->user()->isManagement())
                <div>
                    @if ($user->profile()->get()->isEmpty())
                    <a class="btn btn-primary" href="{{ route('profile.create', $user->id) }}">Create Profile</a>
                    @endif
                    <a class="btn btn-primary" href="{{ route('profile.edit', $user->id) }}">Edit Profile</a>
                </div>
                @endif
            </div>
        </div>
    </div>

    <div class="row flex-wrap mt-2">
        @if($user->profile()->get()->isEmpty())
            <div class="card-header">
                <h3>{{ __("User doesn't have any profile, create one") }}</h3>
            </div>
        @else

        <div class="col-6">
            <div class="card border-0 shadow-md">
                <div class="card-header d-flex flex-wrap justify-content-between align-items-center">
                    <div class="col-12 mb-3">
                        <h4>{{ __('Personal Details') }}</h4>
                    </div>

                    <div class="col-4 mb-2">
                        <small>Birthday</small>
                    </div>

                    <div class="col-8 mb-2 text-right">
                        <h5>{{ $profile && $profile->birthday ?  $profile->birthday : '-' }}</h5>
                    </div>

                    <div class="col-4 mb-2">
                        <small>Phone</small>
                    </div>

                    <div class="col-8 mb-2 text-right">
                        <h5>{{ $profile && $profile->phone ? $profile->phone : '-' }}</h5>
                    </div>

                    <div class="col-4 mb-2">
                        <small>Employment Date</small>
                    </div>

                    <div class="col-8 mb-2 text-right">
                        <h5>{{ $profile && $profile->employed_date ? $profile->employed_date : '-' }}</h5>
                    </div>

                    <div class="col-4 mb-2">
                        <small>Employment Period</small>
                    </div>

                    <div class="col-8 mb-2 text-right">
                        <h5>{{ $employmentPeriod ? $employmentPeriod . " Years" :  '-' }}</h5>
                    </div>

                    <div class="col-4 mb-2">
                        <small>Last Vacation Date</small>
                    </div>

                    <div class="col-8 mb-2 text-right">
                        <h5>{{ $profile && $profile->last_vacation_date ? $profile->last_vacation_date : '-' }}</h5>
                    </div>

                    <div class="col-4 mb-2">
                        <small>Next Vacation Date</small>
                    </div>

                    <div class="col-8 mb-2 text-right">
                        <h5>
                            {{ $nextVacation ? date_format($nextVacation, 'd M Y') : '-' }}
                        </h5>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-6">
            <div class="card border-0 shadow-md">
                <div class="card-header d-flex flex-wrap justify-content-between align-items-center">
                    <div class="col-12 mb-3">
                        <h4>{{ __('Passport & Permit Details') }}</h4>
                    </div>

                    <div class="col-4 mb-2">
                        <small>Nationality</small>
                    </div>

                    <div class="col-8 mb-2 text-right">
                        <h5>{{ $profile && $profile->nationality ? $profile->nationality : '-' }}</h5>
                    </div>

                    <div class="col-4 mb-2">
                        <small>{{ __('Passport Number') }}</small>
                    </div>

                    <div class="col-8 mb-2 text-right">
                        <h5>{{ $profile && $profile->passport_number ? $profile->passport_number : '-' }}</h5>
                    </div>

                    <div class="col-4 mb-2">
                        <small>Last Passport Extend Date</small>
                    </div>

                    <div class="col-8 mb-2 text-right">
                        <h5>{{ $profile && $profile->last_passport_extend ? $profile->last_passport_extend : '-' }}</h5>
                    </div>

                    <div class="col-4 mb-2">
                        <small>Next Passport Extend</small>
                    </div>

                    <div class="col-8 mb-2 text-right">
                        <h5>{{ $nextPassportExtend ? date_format($nextPassportExtend, "d M Y") : '-' }}</h5>
                    </div>

                    <div class="col-4 mb-2">
                        <small>Last Visa Extend Date</small>
                    </div>

                    <div class="col-8 mb-2 text-right">
                        <h5>{{ $profile && $profile->last_visa_extend ? $profile->last_visa_extend : '-' }}</h5>
                    </div>

                    <div class="col-4 mb-2">
                        <small>Next Visa Extend Date</small>
                    </div>

                    <div class="col-8 mb-2 text-right">
                        <h5>{{ $profile ? date_format($nextVisaExtend, 'd M Y') : '-' }}</h5>
                    </div>
                </div>
            </div>
        </div>
        @endif
    </div>

    <div class="row flex-wrap mt-2">
        <div class="col-3"></div>

        <div class="col-9 h-100">
            <div class="row h-100 flex-wrap">
                <div class="card col-12 h-50 border-0 shadow-md mb-2">
                    <div class="card-header d-flex justify-content-between align-items-center">
                        <div>
                            <h3>{{ __('Financial Journal') }}</h3>
                        </div>

                        <div>
                            <a href="{{ route('user.finance.create', $user->id) }}" class="btn btn-primary">Add Journal</a>
                        </div>
                    </div>

                    <div class="card-body">
                        <table class="table table-sm table-striped table-hover">
                            <div class="d-flex justify-content-between align-items-center">
                                <div>
                                    <h4>{{ __('IDR') }}</h4>
                                </div>
                            </div>

                            <thead class="thead-dark text-white">
                                <th>{{ __('Month') }}</th>
                                <th>{{ __('Salaries') }}</th>
                                <th>{{ __('Bonus') }}</th>
                                <th>{{ __('Convert USD') }}</th>
                                <th>{{ __('Loan') }}</th>
                                <th>{{ __('Paid Loan') }}</th>
                                <th>{{ __('Current Loan') }}</th>
                                <th>{{ __('Savings') }}</th>
                                <th>{{ __('Taken Saving') }}</th>
                                <th>{{ __('Current Saving') }}</th>
                                <th>{{ __('Total') }}</th>
                                <th>{{ __('Action') }}</th>
                            </thead>

                            <tbody>
                                @if ($user->finances->isEmpty())
                                <tr>
                                    <td colspan="15">No financial record</td>
                                </tr>
                                @else
                                @foreach($finances as $finance)
                                    <tr>
                                        <td>{{ $finance->month }}</td>
                                        <td>{{ number_format($finance->salaries, 0, ",", ".") }}</td>
                                        <td>{{ number_format($finance->bonus, 0, ",", ".") }}</td>
                                        <td>{{ number_format($finance->convert_usd, 0, ",", ".") }}</td>
                                        <td style="background-color: rgba(218,165,32,.15)">{{ number_format($finance->loan, 0, ",", ".") }}</td>
                                        <td style="background-color: rgba(218,165,32,.15)">{{ number_format($finance->paid_loan, 0, ",", ".") }}</td>
                                        <td style="background-color: rgba(218,165,32,.15)">{{ number_format($finance->current_loan, 0, ",", ".") }}</td>
                                        <td style="background-color: rgba(0,100,0,.15)">{{ number_format($finance->saving, 0, ",", ".") }}</td>
                                        <td style="background-color: rgba(0,100,0,.15)">{{ number_format($finance->taken_saving, 0, ",", ".") }}</td>
                                        <td style="background-color: rgba(0,100,0,.15)">{{ number_format($finance->current_saving, 0, ",", ".") }}</td>
                                        <td>{{ number_format($finance->total, 0, ",", ".") }}</td>
                                        <td>
                                            <a href="/users/finances/{{ $finance->id }}/edit"><span class="material-icons md-12">edit</span></a>
                                        </td>
                                    </tr>
                                @endforeach
                                @endif
                            </tbody>
                        </table>
                    </div>

                    <div class="card-footer">
                        <div class="col">
                            {{ $user->finances->isEmpty() ? '' : $finances->links() }}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

@endsection

and here is the 'resources/views/users/financials/edit.blade.php`

@extends('layouts.app', ['title' => "Add {$user->name} Journal", 'activePage' => 'users'])

@section('content')

<div class="col-md-4 align-self-center">
    <div class="card">
        <div class="card-header">
            <h2 class="card-title">{{ __('Edit Journal Record') }}</h2>
        </div>

        <div class="card-body">
            <form method="POST" action="{{ route('userfinancial.update', $finance->id) }}">
                @csrf
                @method('put')

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

                    <div class="col-md-6">
                        <select id="month" class="custom-select @error('month') is-invalid @enderror" name="month" required autofocus>
                            <option value="" {{ old('month') == '' ? 'selected' : '' }}>Select Month</option>
                            @for ($m = 1; $m < 13; $m++)
                            <option value="{{ $m }}" {{ old('month') == $m ? 'selected' : '' }}>{{ date_format(\Carbon\Carbon::create(date('Y'), $m, 1), 'F') }}</option>
                            @endfor
                        </select>

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

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

                    <div class="col-md-6">
                        <select id="year" class="custom-select @error('year') is-invalid @enderror" name="year" required>
                            <option value="" {{ old('year') == '' ? 'selected' : '' }}>Select Year</option>
                            @for($y = 0; $y < 6; $y++)
                                <option value="{{ \Carbon\Carbon::now()->subYears($y)->year }}" {{ old('year') == \Carbon\Carbon::now()->subYears($y)->year || \Carbon\Carbon::now()->year == \Carbon\Carbon::now()->subYears($y)->year ? 'selected' : '' }}>{{ \Carbon\Carbon::now()->subYears($y)->year }}</option>
                            @endfor
                        </select>

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

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

                    <div class="col-md-6">
                        <input id="text" type="salaries" class="form-control @error('salaries') is-invalid @enderror" name="salaries" value="{{ old('salaries') }}" placeholder="+">

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

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

                    <div class="col-md-6">
                        <input id="text" type="bonus" class="form-control @error('bonus') is-invalid @enderror" name="bonus" value="{{ old('bonus') }}" placeholder="+">

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

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

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

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


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

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

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

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

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

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

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

                    <div class="col-md-6">
                        <input id="text" type="saving" class="form-control @error('saving') is-invalid @enderror" name="saving" value="{{ old('saving') }}" placeholder="+">

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

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

                    <div class="col-md-6">
                        <input id="text" type="taken_saving" class="form-control @error('taken_saving') is-invalid @enderror" name="taken_saving" value="{{ old('taken_saving') }}" placeholder="+">

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

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

                    <div class="col-md-6">
                        <textarea id="remarks" type="text" class="form-control @error('remarks') is-invalid @enderror" name="remarks" placeholder="Remarks" rows="3" maxlength="180"></textarea>

                        @error('remarks')
                            <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">
                            {{ __('Create') }}
                        </button>
                        <a href="{{ route('profile', $user->id) }}" class="btn btn-danger">{{ __('Back') }}</a>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

@endsection

Sinnbeck's avatar

and here is the 'resources/views/users/financials/edit.blade.php`

Shouldnt that be financial? Without s

Please or to participate in this conversation.