1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- /*
- |--------------------------------------------------------------------------
- | Web Routes
- |--------------------------------------------------------------------------
- |
- | Here is where you can register web routes for your application. These
- | routes are loaded by the RouteServiceProvider within a group which
- | contains the "web" middleware group. Now create something great!
- |
- */
- Route::get('/', function () {
- $data = [
- ["id" => 1, "login" => "vasya"],
- ["id" => 2, "login" => "petya"],
- ["id" => 3, "login" => "kolya"],
- ["id" => 4, "login" => "nasimi"],
- ];
- //return $data;
- return view('welcome', ['aaa' => 'bbbb' ,'userList' => $data]);
- });
- Route::get('/about', function () {
- return ;
- });
- Route::get('/tag/{text}', function (String $text) {
- $tag = \App\Tag::where('tag', $text)->first();
- return $tag->posts;
- });
- Route::get('/multiply_table/{width}/{height}', function ($width, $height) {
- $arr = [];
- for ($y=1;$y<=$height;$y++){
- $arr[] = [];
- for ($x=1;$x<=$width;$x++){
- $arr[$y -1][$x -1] = $x * $y;
- }
- }
- return view('multiply_table', ["table" => $arr]);
- })->where(['width' =>'[0-9]+', 'height' =>'\d+'] )
- ->name('multiply');
- Route::resource('/cntrl',"SomeController");
- Route::resource('/comment',"CommentController");
|