<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; use App\Http\Controllers\Controller; class TestController extends Controller { public function index() { $data['tasks'] = [ [ 'name' => 'Design New Dashboard', 'progress' => '87', 'color' => 'danger' ], [ 'name' => 'Create Home Page', 'progress' => '76', 'color' => 'warning' ], [ 'name' => 'Some Other Task', 'progress' => '32', 'color' => 'success' ], [ 'name' => 'Start Building Website', 'progress' => '56', 'color' => 'info' ], [ 'name' => 'Develop an Awesome Algorithm', 'progress' => '10', 'color' => 'success' ] ]; return view('test')->with($data); } }
3.创建对应的路由
Route::get('test', 'TestController@index');
4.打开对应的页面,如果你没有出错的 应该如下图所示
您可能感兴趣的文章: