Here is an example (It's in Laravel 4).. I want my url like this http://example.com/home/SiteLocation
and in routes.php
I defined Route::get('home/SiteLocation','HomeController@Functionname');
My point is,
Is it possible to use like this SiteLocation
(lower case and upper case mix) as url ?
If yes, how to define function in controller for the same ?
Is it possible to use like this SiteLocation (lower case and upper case mix) as url ?
Yes - it should just work, you shouldnt need to modify your code
If yes, how to define function in controller for the same ?
Your function name in your controller can be anything you like - it doesnt need to correspond to the url. For example this would work:
Route::get('home/SiteLocation','HomeController@siteLocation');
as would this:
Route::get('home/SiteLocation','HomeController@SiteLocation');
and this:
Route::get('home/SiteLocation','HomeController@other');
It’s always good practice to avoid using capital letters in your URLs.