-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathapp_routes_example
121 lines (98 loc) · 3.21 KB
/
app_routes_example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
use ZeroTierCentralAPILib\ZeroTierCentralAPIClient;
use ZeroTierCentralAPILib\Controllers;
use ZeroTierCentralAPILib\APIHelper;
use ZeroTierCentralAPILib\Tests\UserControllerTest;
Route::get('zerotierapi/', function() {
$oAuthAccessToken = "rK4rumasemnAbKG7xa9Y6mdVn96qtU5t";
$client = new ZeroTierCentralAPILib\ZeroTierCentralAPIClient($oAuthAccessToken);
//Get singleton instance
$generalQueries = $client->getGeneralQueries();
//getStatusAndConfigurationInformation
$result_sci = $generalQueries->getStatusAndConfigurationInformation();
$status_config = json_encode($result_sci);
//getCurrentlyAuthenticatedUser
$result_au = $generalQueries->getCurrentlyAuthenticatedUser();
$auth_user = json_encode($result_au);
//getGenerateARandomToken
$result_gart = $generalQueries->getGenerateARandomToken();
$random_token = json_encode($result_gart);
return $status_config;
});
/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in 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.
|
*/
// create an item
Route::post('test', function(){
echo "POST";
});
// read an item
Route::get('test', function(){
echo "GET";
});
// update an item
Route::put('test', function(){
echo "PUT";
});
// delete an item
Route::delete('test', function(){
echo "DELETE";
});
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
/*
Route::get('/', function () {
return view('layouts/trueview');
});
Route::get('/test', function () {
return view('layouts/trueview');
});
Route::get('/particial/index', function () {
return view('particial.index');
});
*/
Route::group(['middleware' => 'web'], function () {
Route::auth();
Route::get('/', function () {
return view('welcome');
});
/*
Route::get('/', function () {
return view('layouts/trueview');
})->middleware('auth');
Route::get('/test', function () {
return view('layouts/trueview');
})->middleware('auth');
*/
Route::get('/particial/index', function () {
return view('particial.index');
})->middleware('auth');
Route::get('/customer/{id}', function ($id) {
$customer = App\customer::find($id);
echo "Hello my name is ". $customer->name;
});
Route::get('/get_customer', function () {
$customer = App\customer::where('name', '=', 'lola')->first();
echo $customer->id;
})->middleware('auth');
Route::get('/home', 'HomeController@index');
});
Route::group(['middleware' => 'web'], function () {
Route::auth();
Route::get('/home', 'HomeController@index');
});