skip to Main Content

Laravel 10 route create beautiful URL

I have route: Route::resource('posts', PostController::class); Within URL (1): domain.com/posts will show all posts. Within URL (2): domain.com/posts?status=trashed will show all soft deleted posts. How I want to create a beautiful URL which replace the URL (2)? Such as domain.com/posts/status/trashed, or…

VIEW QUESTION

Laravel Blade does not load if ajax is added

When I add the following ajax to my laravel blade file the page stops rendering. If ajax part is removed the page renders perfectly fine <input type="text" name="voucher_no" id="voucher_no" class="form-control"> <input type="text" name="year" id="year" value="{{ date('Y') }}"> <button type="button" id="convertFinal"…

VIEW QUESTION

Laravel – Nested loop: interval loop brings results for the first iteration of the main loop

I am writing a laravel code in which I need a nested loop in the blade. Here is my controller public function show(string $id) { $transaction = Transaction::findOrFail($id); $subject_ids = DB::connection('transfer') ->table('subjects') ->join('transactions_subjects', 'transactions_subjects.subject_id', '=', 'subjects.id') ->where('transactions_subjects.transaction_id', '=', $transaction->id) ->distinct()…

VIEW QUESTION
Back To Top
Search