Support the ongoing development of Laravel.io →
Requests Laravel
Last updated 2 years ago.
0
moderator

You could do the following:

// If you are using route model binding
Route::get('post/{post}/helperFunctionCall', function ($post) {
    helperFunctionCall($post->id);
});

// If you are not using route model binding and `{post}` in the URL is an ID
Route::get('post/{post}/helperFunctionCall', function () {
    helperFunctionCall($post);
});
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Ashley ashley Joined 9 Oct 2019

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.