//route.php
Route::model('service', 'Modules\Front\Models\Services');
Route::any('services/{service}', ['as' => 'services.show', 'uses' => 'Modules\Front\Http\Controllers\ServicesController@show']);
//Controller
class ServicesController extends BaseController
{
public function show(Services $service)
{
dd($service);
$services = Services::all();
return view('front::services.show', compact('services', 'service'));
}
}
//result dd() - empty object
Services {#381 ▼
#guarded: []
#table: "content"
#fillable: array:5 [▶]
#visible: array:6 [▶]
#casts: array:6 [▶]
#connection: null
#primaryKey: "id"
#perPage: 15
+incrementing: true
+timestamps: true
#attributes: []
#original: []
#relations: []
#hidden: []
#appends: []
#dates: []
#dateFormat: null
#touches: []
#observables: []
#with: []
#morphClass: null
+exists: false
+wasRecentlyCreated: false
#forceDeleting: false
}