Loading video...
Challenge
Routing
Coding Challenge
Problem
Create Route which accepts two route parameters. These parameters should be integers. You should calculate the sum of these two parameters and print that sum.
Solution
Route::get('/sum/{a}/{b}', function(float $a, float $b) {
echo "Sum: " . ($a + $b);
})
->whereNumber(['a', 'b'])
;