1.建立路由
Route::get('home','HomeController@index');
2.建立控制器
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use DB,Session,Config,Mail;
use Cache;
use Redis;
class HomeController extends Controller
{
public function index(){
// $mem=new Memcache();
// $mem->connect("127.0.0.1",11211);
// $mem->set("name",'haoyunyun');
// echo $mem->get("name");
Cache::put('key1','wagnwu',5);
print_r(Cache::get('key1'));
}
}