php - Server Error 500 While loading my index page in laravel 7

please I don't know what else to be done. I created a resource controller and all was ok the create.blade was accessible and working fine, in fact, was saving to the database. even the index page was working before when it was just common HTML, but immediately I inserted the PHP details it starts loading server error 500. please see below:
My index.blade
<div class="col-md-6" style="float:right">
<a href="{{ route('paymentdetails.create') }}" class="btn btn-primary btn-rounded float-right">
<i class="fas fa-plus mr-2"></i>
@lang('Add Paymentdetails')
</a>
</div>
<div class="table-responsive" id="users-table-wrapper">
<table class="table table-borderless table-striped">
<thead>
<tr>
<th class="min-width-80">@lang('Username')</th>
<th class="min-width-150">@lang('Amountpaid')</th>
<th class="min-width-100">@lang('Description')</th>
<th class="min-width-80">@lang('Created_at')</th>
<th class="min-width-80">@lang('Updated_at')</th>
<th class="text-center min-width-150">@lang('Action')</th>
</tr>
</thead>
<tbody>
@if (count($paymentdetails))
@foreach ($paymentdetails as $paymentdetail)
<tr>
<td class="align-middle">
<a href="{{ route('paymentdetails.show', $paymentdetail) }}">
{{ $paymentdetail->username }}
</a>
</td>
<td class="align-middle">{{ $paymentdetail->amountpaid }}</td>
<td class="align-middle">{{ $paymentdetail->description }}</td>
<td class="align-middle">{{ $paymentdetail->created_at }}</td>
<td class="align-middle">{{ $paymentdetail->updated_at }}</td>
<td class="text-center align-middle">
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuLink">
<a href="{{ route('paymentdetails.show', $paymentdetail) }}" class="dropdown-item text-gray-500">
<i class="fas fa-eye mr-2"></i>
@lang('View Paymentdetails')
</a>
</div>
<a href="{{ route('paymentdetails.edit', $paymentdetail) }}"
class="btn btn-icon edit"
title="@lang('Edit Paymentdetail')"
data-toggle="tooltip" data-placement="top">
<i class="fas fa-edit"></i>
</a>
<a href="{{ route('paymentdetails.destroy', $paymentdetail) }}"
class="btn btn-icon"
title="@lang('Delete Paymentdetail')"
data-toggle="tooltip"
data-placement="top"
data-method="DELETE"
data-confirm-title="@lang('Please Confirm')"
data-confirm-text="@lang('Are you sure that you want to delete this user?')"
data-confirm-delete="@lang('Yes, delete him!')">
<i class="fas fa-trash"></i>
</a>
</td>
</tr>
@endforeach
@else
<tr>
<td colspan="7"><em>@lang('No records found.')</em></td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
</div>
My controller from web
<?php
namespace Vanguard\Http\Controllers\Web;
use Illuminate\Http\Request;
use Illuminate\View\View;
use Vanguard\Http\Controllers\Controller;
Use Vanguard\Paymentdetails;
class PaymentdetailsController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
// dd("am here");
return view('/paymentdetails.index');
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
return view('/paymentdetails/create');
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$this->validate($request, [
'username'=>'required',
'amountpaid'=>'required',
'description'=>'required',
]);
$paymentdetails = new Paymentdetails;
$paymentdetails->username = $request-> input('username');
$paymentdetails->amountpaid = $request-> input('amountpaid');
$paymentdetails->description = $request-> input('description');
$paymentdetails->save();
return redirect()->route('paymentdetails.index')
->withSuccess(__('Paymentdetails created successfully.'));
// if($saveFlag){
// return redirect()->back();
// }
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
$paymentdetails = Paymentdetails::find($id);
//dd($paymentdetails);
return view('/paymentdetails/view')->with('paymentdetails',$paymentdetails);
}
My controller from API
<?php
namespace Vanguard\Http\Controllers\Api\Paymentdetails;
use Illuminate\Http\Request;
use Vanguard\Http\Controllers\Api\ApiController;
Use Vanguard\Paymentdetails;
class PaymentdetailsController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
// dd("am here");
return view('/paymentdetails.index');
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
return view('/paymentdetails/create');
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$this->validate($request, [
'username'=>'required',
'amountpaid'=>'required',
'description'=>'required',
]);
$paymentdetails = new Paymentdetails;
$paymentdetails->username = $request-> input('username');
$paymentdetails->amountpaid = $request-> input('amountpaid');
$paymentdetails->description = $request-> input('description');
$paymentdetails->save();
return redirect()->route('paymentdetails.index')
->withSuccess(__('Paymentdetails created successfully.'));
// if($saveFlag){
// return redirect()->back();
// }
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
$paymentdetails = Paymentdetails::find($id);
//dd($paymentdetails);
return view('/paymentdetails/view')->with('paymentdetails',$paymentdetails);
}
my route(web)
/**
* Paymentdetails
*/
Route::resource('/paymentdetails', 'PaymentdetailsController')->middleware('permission:paymentdetails.manage');
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: you must enable the openssl extension in your php.ini to load information from https://repo.packagist.org
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.