当前位置: 首页>>代码示例>>PHP>>正文


PHP Route::Get方法代码示例

本文整理汇总了PHP中Route::Get方法的典型用法代码示例。如果您正苦于以下问题:PHP Route::Get方法的具体用法?PHP Route::Get怎么用?PHP Route::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Route的用法示例。


在下文中一共展示了Route::Get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

<?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::get('/', 'boxofficecontroller@show');
Route::post('save', 'mastercontroller@saverecord');
Route::post('update', 'mastercontroller@updaterecord');
Route::post('showdata', 'mastercontroller@display');
Route::get('/home', 'mastercontroller@index');
Route::Get('/boxoffice', 'mastercontroller@boxoffice');
Route::post('editdata', 'mastercontroller@edit');
Route::post('deletedata', 'mastercontroller@delete');
Route::get('/auth/facebook', 'Auth\\AuthController@redirectToProvider');
Route::get('/callback', 'Auth\\AuthController@handleProviderCallback');
开发者ID:andreaschristian,项目名称:laravel,代码行数:26,代码来源:routes.php

示例2: function

//       $user->save();
//
//       return Response::json(array('token' =>$token,'user'=>$user->toArray()));
//   }
//    catch(exception $e)
//    {
//        App::abort(404,$e->getMessage());
//    }
//});
Route::Get('API/login/{email}/{password}', function ($email, $password) {
    $credentials = array('email' => $email, 'password' => $password);
    if (Auth::once($credentials)) {
        $token = hash('sha256', Str_random(60), false);
        //產生隨機編碼放入token
        $user = Auth::user();
        //取得user model
        $user->api_token = $token;
        //準備把 token 存入資料庫
        $user->save();
        return Response::json(array('token' => $token, 'user' => $user->toArray()));
        //把資料以 json 格式回應成網頁
    }
});
Route::post('post', function () {
    $email = Request::input('email');
    $password = Request::input('password');
    $credentials = array('email' => $email, 'password' => $password);
    if (Auth::once($credentials)) {
        $token = hash('sha256', Str_random(60), false);
        //產生隨機編碼放入token
        $user = Auth::user();
        //取得user model
开发者ID:cbt36594,项目名称:LaravelPartice,代码行数:32,代码来源:routes.php

示例3: function

        Mail::send('home', ['name' => 'leontin'], function ($message) {
            $message->to('calimanleontin@gmail.com', 'leontin')->from('calimanleontin@gmail.com')->subject('welcome');
        });
    });
    Route::group(['middleware' => ['auth']], function () {
        Route::get('category/create', 'CategoryController@create');
        Route::post('category/store', 'CategoryController@store');
        Route::get('/product/create', 'ProductController@create');
        Route::post('/product/store', 'ProductController@store');
        Route::get('/cart/index', 'CartController@index');
        Route::get('/cart/increase/{id}', 'CartController@increase');
        Route::get('/cart/decrease/{id}', 'CartController@decrease');
        Route::get('/cart/delete/{id}', 'CartController@delete');
        Route::post('/comment/store', 'CommentController@store');
        Route::post('/finish-order', 'CartController@finish');
        Route::get('comment/delete/{id}', 'CommentController@delete');
        Route::get('comment/edit/{id}', 'CommentController@edit');
        Route::post('comment/update', 'CommentController@update');
        Route::get('finish-cart', 'CartController@finish');
        Route::get('/order-history', 'CartController@history');
        Route::get('/edit-profile', 'UserController@edit_profile');
        Route::get('/user-profile', 'UserController@profile');
        Route::post('/profile/update', 'UserController@update_profile');
        Route::get('/edit/product/{id}', 'ProductController@edit');
        Route::post('/update/product', 'ProductController@update');
        Route::get('order-details/{id}', 'CartController@order_details');
    });
    Route::get('/to-cart/{id}', 'CartController@add')->where('id', '[0-9]+');
    Route::Get('/product/{slug}', 'ProductController@show');
    Route::get('/category/{slug}', 'CategoryController@show');
});
开发者ID:calimanleontin,项目名称:e-commerce,代码行数:31,代码来源:routes.php

示例4:

<?php

/******************************************************************************************************************************
 *
 *	AUTHOR		: Jan Klemmensen 
 *	CREATED		: 1/8/2014
 *
 *  PURPOSE		: This is where you define your routes - At the moment GET and POST can be used
 *				  Adding wildcards  : Route::Get( '/users/:id', 'IndexController', 'getIndex' );
 *				  Getting wildcards : echo Route::Request('id'); ******************************************************************************************************************************
*/
# Index page
Route::Get('/', 'IndexController', 'getIndex');
Route::Post('/', 'IndexController', 'postIndex');
开发者ID:Klemmensen,项目名称:mvc-skeleton,代码行数:14,代码来源:routes.php

示例5: function

<?php

require_once "Route/config.php";
/**
 *	Route List 
 *  Author: Vincent Nacar
 */
// add your route here
Route::Get("Register", function () {
    require_once "View/Register-template/Register.php";
});
Route::Get("Register-Submit", function () {
    require_once "View/Register-template/Register-status.php";
});
Route::Get("Login", function () {
    require_once "View/login-template/Login.php";
});
开发者ID:vincentnacar02,项目名称:Customer-Support-Portal,代码行数:17,代码来源:Routes.php

示例6: function

use App\Models\SiteComponents\HomePage;
use App\Models\People\Employee;
use App\Models\Internal\ZipCode;
use App\Models\SiteComponents\Gallery;
use App\Models\SiteComponents\NewsArticle;
use App\Models\SiteComponents\Special;
use App\Models\SiteComponents\ImageList;
use App\Http\Controllers\Sitemap;
use App\Models\Forms\BuildingQuote;
use App\Models\Forms\EmploymentApp;
use App\Models\Forms\ContactForm;
Route::get('api/token', function () {
    return csrf_token();
});
Route::Get('locations-test', function () {
    return "<a href=\"/?location=1\">Brookhaven</a><br />\n\t<a href=\"/?location=2\">Lake Charles</a><br />\n\t<a href=\"/?location=3\">Tupelo</a><br />\n\t<a href=\"/?location=4\">Benton</a><br />\n\t<a href=\"/?location=5\">Jackson</a><br />\n\t";
});
Route::resource('api/employees', 'People\\EmployeeController');
Route::resource('api/images', 'SiteComponents\\ImageController');
Route::resource('api/locations', 'SiteComponents\\LocationController');
Route::resource('api/galleries', 'SiteComponents\\GalleryController');
Route::resource('api/buildingcomponents/canopies', 'BuildingComponents\\CanopyController');
Route::resource('api/buildingcomponents/framedopenings', 'BuildingComponents\\FramedOpeningController');
Route::post('api/images/upload', 'SiteComponents\\ImageController@upload');
Route::post('api/images/attach', 'SiteComponents\\ImageController@attach');
Route::post('api/locations/upload-logo', 'SiteComponents\\LocationController@uploadLogo');
Route::post('api/locations/upload-aerial', 'SiteComponents\\LocationController@uploadAerial');
Route::post('api/locations/upload-slider', 'SiteComponents\\LocationController@uploadSlider');
Route::post('api/locations/order-slider', 'SiteComponents\\LocationController@orderSlider');
Route::post('api/locations/edit-slider/{id}', 'SiteComponents\\LocationController@editSlider');
Route::resource('api/forms/recipients', 'People\\FormRecipients');
开发者ID:stevendesu,项目名称:reedsmetals.com,代码行数:31,代码来源:routes.php

示例7:

Route::get('/home/members', 'HomeController@members');
Route::get('/home/announcements', 'HomeController@announcements');
Route::get('/home/legal', 'HomeController@legal');
Route::get('/home/faq', 'HomeController@faq');
Route::get('/create/acc_details', 'HomeController@update');
Route::post('/create/acc_details/process', 'HomeController@handleUpdate');
Route::get('/create/questionnaire', 'HomeController@updateQuestionnaire');
Route::post('/create/questionnaire/process', 'HomeController@handleUpdateQuestionnaire');
Route::get('/edit_profile', 'HomeController@updateProfile');
Route::post('/edit_profile/process', 'HomeController@handleUpdateProfile');
// Routes for InvestmentController
Route::model('investment', 'App\\Investment');
Route::get('/investment', 'InvestmentController@index');
Route::get('/investment/create', 'InvestmentController@create');
Route::post('/investment/create/process', 'InvestmentController@handleCreate');
Route::get('/investment/list', 'InvestmentController@investedBusiness');
Route::get('/payment/list/investor', 'InvestmentController@paymentListInvestor');
Route::get('/payment/list/investor/detail/{investment}', 'InvestmentController@paymentListInvestorDetail');
// Routes for BusinessController
Route::model('business', 'App\\Business');
Route::get('/business', 'BusinessController@index');
Route::get('/business/create', 'BusinessController@create');
Route::post('/business/create/process', 'BusinessController@handleCreate');
Route::get('/business/list', 'BusinessController@showBusiness');
Route::get('/business/list/detail/{business}', 'BusinessController@showBusinessDetail');
Route::get('/business/list/detail/investor/{business}', 'BusinessController@showBusinessDetailForInvestor');
Route::Get('/available_business/list/detail/{business}', 'BusinessController@showListOfAvailableBusinessDetailForInvestor');
Route::post('/business/agreement', 'BusinessController@agreement');
Route::get('/payment/list/business_issuer', 'BusinessController@paymentListBusinessIssuer');
Route::get('/payment/list/business_issuer/detail/{business}', 'BusinessController@paymentListBusinessIssuerDetail');
Route::post('/payment/list/business_issuer/detail/process_payment', 'BusinessController@processPayment');
开发者ID:stevenPutuJaye,项目名称:Project_S,代码行数:31,代码来源:routes.php


注:本文中的Route::Get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。