I have this method:
public function getAll( $name = false, $json = false ) {
if ( $name )
$sections = Sections::all()->pluck( 'name' );
else
$sections = Sections::all();
return ( $json ) ? json_encode( $sections ) : $sections;
}
And address for this is: example.com/api/sections/all/{name}/{json}
So i have question for this - how to define address for TRUE parameter?
In my opinion example.com/api/sections/all/true/true
is not good idea because I'm showing parameters types.
What solution do you propose? Or maybe another method construction?