OK all I am so lost. The following prints our [] an empty array. This is really messing me up. AppServiceProvider to populate the dropdown

```
\View::composer(['layouts/frontend/partials/header'], function ($view) { $title = Weekend::all('title','id'); $view->with(['title'=>$title]); });

```

route
Route::get('weekends/{weekend:title}',[PagesController::class,'getCurrent']);`

Link to the individual page

```
 @foreach($title as $title) <li><a href="weekends/{{$title->title}}">{{$title->title}}</a></li> @endforeach``` controller ``` public function getCurrent(Weekend $title) { return $title; }

```

And the Model

```
<?php

namespace App\Models\Webmaster;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Weekend extends Model
{
    use HasFactory;
    protected $fillable = [];

    public function weekendTeamMembers() {
        return $this->hasMany(App\Models\Webmaster\WeekendTeamMember::class);
    }

    public function getRouteKeyName() {
        return 'title';
    }

}

enter code here

```

I have everything working but I would like to have the url passing the weekend title instead of ID. Not sure how to do this. In my AppService Provider I have the following to populate the navbar dropdown with titles:

```
\View::composer(['layouts/frontend/partials/header'], function ($view) {
    $title = Weekend::all('title', 'id');

    $view->with(['title'=>$title]);
});

```

My route for each individual page is

```
Route::get('weekends/{weekend}', [PagesController::class, 'getCurrent']);

```

The Link is

```
@foreach ($title as $title)
    <li><a href="{{ $title->id }}">{{ $title->title }}</a></li>
@endforeach

```

**But if I change `{{ $title->id }}` to `{{ $title->title }}` I get 404.**

And the controller is

```
public function getCurrent(Weekend $weekend)
{
    return view('pages.weekend')->with(['weekend'=> $weekend]);
}

```