public function modifyTrxId($str) { $random = new \Rych\Random\Random(); $remaining = 30 - strlen($str); $newRandomString = $random->getRandomString($remaining); return $newRandomString . $str; }
/*Route::get('/practice', function() { echo 'Hello world!'; });*/ Route::get('/', function () { return view('welcome'); }); # Explicit routes for Books Route::get('/books', 'BookController@getIndex'); Route::get('/books/show/{title?}', 'BookController@getShow'); Route::get('/books/create', 'BookController@getCreate'); Route::post('/books/create', 'BookController@postCreate'); # Alternative to the above, using implicit Controller routing //Route::controller('/books','BookController'); Route::get('/practice', function () { $random = new Rych\Random\Random(); return $random->getRandomString(16); }); /*<?php |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It's a breeze. Simply tell Laravel the URIs it should respond to | and give it the controller to call when that URI is requested. | */ Route::get('/', function () { return view('welcome'); }); Route::controller('/practice', 'PracticeController');
When you're done debugging, comment it back out so you don't accidentally leave it running on your live server, making your credentials public. */ //print_r(config('database.connections.mysql')); echo '<h1>Test Database Connection</h1>'; try { $results = DB::select('SHOW DATABASES;'); echo '<strong style="background-color:green; padding:5px;">Connection confirmed</strong>'; echo "<br><br>Your Databases:<br><br>"; print_r($results); } catch (Exception $e) { echo '<strong style="background-color:crimson; padding:5px;">Caught exception: ', $e->getMessage(), "</strong>\n"; } echo '</pre>'; }); Route::get('/practice', function () { $random = new Rych\Random\Random(); return $random->getRandomString(8); }); Route::get('/books/show/{title?}', 'BookController@getShow'); Route::get('/books', 'BookController@getIndex'); Route::get('/books/create', 'BookController@getCreate'); Route::post('/books/create', 'BookController@postCreate'); Route::get('logs', '\\Rap2hpoutre\\LaravelLogViewer\\LogViewerController@index'); Route::get('/tag', 'TagController@index'); Route::get('/tag/create', 'TagController@create'); Route::post('/tag', 'TagController@store'); Route::get('/tag/{tag_id}', 'TagController@show'); Route::get('/tag/{tag_id}/edit', 'TagController@edit'); Route::put('/tag/{tag_id}', 'TagController@update'); Route::delete('/tag/{tag_id}', 'TagController@destroy');
$view = '<form method="POST">'; $view .= csrf_field(); # This will be explained more later $view .= 'Title: <input type="text" name="title">'; $view .= '<input type="submit">'; $view .= '</form>'; return $view; }); Route::post('/new', function () { $input = Input::all(); print_r($input); }); //Practise Route to see app::environment Route::get('/practice', function () { echo App::environment(); $data = array('foo' => 'bar'); Debugbar::info($data); Debugbar::error('Error!'); Debugbar::warning('Watch out…'); Debugbar::addMessage('Another message', 'mylabel'); $random = new Rych\Random\Random(); return ' ' . $random->getRandomString(8); }); //Intial Route for Lorem Ipsum // Route::get('/loremipsum/{noOfParas}', function($noOfParas) { // return 'This is loremipsum Page for ' .$noOfParas .' Paragraph(s)'; // }); //Intial Route for Random User // Route::get('/randomuser/{noOfUsers}', function($noOfUsers) { // return $noOfUsers.' Users Generated'; // });