mercredi 7 décembre 2022

page not opening when click the post

I am newbie in development please help,Do not judge me. Remember everyone starts from 0.

When I click my ticket it is not opening specific page while click link of my ticket it shows in link correct ticket id but page not opening "404 not found"

Ticket.blade.php

`

                        
                                <tr>
                                                                     
                                                                     
                                    @foreach ($ticketsinfos as $ticketinfo)
                                    <td>IR-173049</td>
                                    <td>Dito Katsarava</td> 
                                    <td></td>
                                    
                                    <td><a href="/tickets/show/"></a></td>
                                    
                                    <td><button class="btn btn-danger btn-sm" type="button">Action Needed<br></button><br></td>
                                    <td>Tako Kiknadze</td>
                                    <td></td>
                                    <td></td>
                                </tr>

                                @endforeach  
                              
                                </tr>

`

web.php

`

<?php

use App\Http\Controllers\AdminsUserController;
//use App\Http\Controllers\UserController;
//use App\Http\Controllers\CompaniesController;
use App\Http\Controllers\DashboardController;
use App\Http\Controllers\TicketsController;
//use App\Models\AdminsUser;
//use App\Models\Companies;
use Illuminate\Support\Facades\Route;

/*
|----------------------------------------------z----------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

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

Route::resource('/dashboard', DashboardController::class);

Route::resource('/tickets', TicketsController::class);

Route::resource('/admin/users', AdminsUserController::class);
// Route::resource('/companies', CompaniesController::class);




Auth::routes();

Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');


`

Controller

`

  public function show(Tickets $tickets)
    {
        //
        $tickets = Companies::with('tickets')->get();

        $severities = Severities::with('severity')->get();
        
        $ticketsinfos = Tickets::with('companies')->findOrFail(2);
    
        

  
     return view('customer.index', compact($tickets))->with(['tickets' => $tickets])->with(['severities' => $severities])->with(['ticketsinfos' => $ticketsinfos]);

    //dd($ticketsinfos->toArray());
        
    }

`

When I 'dd' works

Thanks you.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire