public function modifyTrxId($str)
 {
     $random = new \Rych\Random\Random();
     $remaining = 30 - strlen($str);
     $newRandomString = $random->getRandomString($remaining);
     return $newRandomString . $str;
 }
 public function postRandomUser(Request $request)
 {
     //Validate that Number of Users is integer
     $this->validate($request, ['noOfUsers' => 'required|numeric']);
     $contents = Storage::get('libraries/Names.txt');
     $content_array = explode('<@>', $contents);
     $noOfUsers = $request->input('noOfUsers');
     $withProfile = $request->input('withProfile');
     $users = array();
     $content_array_size = sizeof($content_array);
     for ($i = 0; $i < $noOfUsers; $i++) {
         $random = new \Rych\Random\Random();
         $randomNumber = $random->getRandomInteger(0, $content_array_size - 1);
         $name = $content_array[$randomNumber];
         $email = str_replace(" ", "_", $name);
         $email = "Email:\n" . $email . "@webdevelopment.info.com" . "\n\n";
         if ($withProfile == 'Yes') {
             $generator = new Generator();
             $profile = $generator->getParagraphs(1);
             $profile = implode('<p>', $profile);
             $email = $email . "Profile:\n" . $profile;
         }
         $randomNumber = $random->getRandomInteger(1, 5);
         $userPic = 'img\\User_' . $randomNumber . '.jpg';
         $users[$name] = array($email, $userPic);
     }
     return view('randomuser.randomUser')->with('title', 'Random User Generator')->with('users', $users);
 }
Esempio n. 3
0
    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');
Esempio n. 4
0
*/
/*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');
});
Esempio n. 5
0
    $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';
// });