Support the ongoing development of Laravel.io →
posted 10 years ago
Configuration
Last updated 1 year ago.
0

I have helped to port the first the three routes for you. I suggest you to read up on laravel routing at http://laravel.com/docs/routing

Route::get('/redirect/index/{any}', array('uses' => 'ControllerName@FunctionName'));
Route::get('/shorten/create', array('uses' => 'ControllerName@FunctionName'));
Route::get('/stats/view', array('uses' => 'ControllerName@FunctionName'));
Last updated 1 year ago.
0

This is how I would have done it.

<?php
Route::get('shorten/create', [
	'as' => 'createUrl',
	'uses' => 'ShortenController@getCreate'
]);

Route::get('stats/view', [
	'as' => 'statsView',
	'uses' => 'StatsController@getView'
]);

Route::get('/', [
	'as' => 'index',
	'uses' => 'ShortenController@getIndex'
]);

Route::get('{shortUrl}', [
	'as' => 'url',
	'uses' => 'ShortenController@getUrl'
]);
Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

anishpsla anishpsla Joined 10 Feb 2014

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.