skip to Main Content

Target class does not exist. Routing Prefix Laravel 9

I am learning Laravel 9, and I got a problem Target class [AdminDashboardController] does not exist. when using prefix routing. Is someone can help me to fix it? this code on routes/web: Route::prefix('admin')->namespace('Admin')->group(function(){ Route::get('/','DashboardController@index')->name('dashboard'); }); this code on AppHttpControllersAdminDashboardController: namespace…

VIEW QUESTION

View ['view.name'] not found – Laravel

why I have this Problem please? this is my blade code in laravel 9: <form class="row g-3" method="POST" action="{{ route('users.store') }}" > @csrf @include('users.partials.form') <div class="col-12"> <button class="btn btn-primary" type="submit" >Add user</button> </div> </form> this is the structure of my…

VIEW QUESTION

Laravel: How do you pass data to a blade.php?

I am having difficulty in understanding how to pass data to a .blade. I want to pass the users' username ($user) to a dashboard component. Here's a few things I've tried: return view('livewire.dashboard', ['user'=>'$user']); return view('livewire.dashboard', compact('$user')); return view('livewire.dashboard'->with('user',$user)); But…

VIEW QUESTION

Using variables in laravel blade template

Could anyone help me to understand how to use variables in the following case: @for($i = 0; $i < 3; $i++) @if(isset($images->image_$i_url)) <div class="w-25" > <img src="{{ Storage::url($images->image_$i_url) }}" alt="image" style="width: 128px;"> </div> @endif <div class="form-group"> <div class="input-group"> <div class="custom-file">…

VIEW QUESTION

Splitting Paginated Blade – Laravel

Below is my controller code $category_ids = array(); foreach($categories as $category){ $category_ids[] = $category->id; } $paginated_products = Product::where('status',1)->whereIn('category_id',$category_ids)->latest()->paginate(30); Below is my blade view code $first_ten_products = array_slice($paginated_products,0,9); But am getting the error below how can i fix it. Thanks array_slice():…

VIEW QUESTION

assertSee failed due to whitespaces in html code – Laravel

In my blade, I have a button: <a href="/customer/member/delete/{{ $member->id }}" class="btn btn-secondary delete-button" > Delete </a> And I want to test it: $this->view->assertSee('<a href="/customer/member/delete/1" class="btn btn-secondary delete-button">Delete</a>'); How can I ignore whitespaces in the test? A tried: trim and…

VIEW QUESTION
Back To Top
Search