-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.php
66 lines (50 loc) · 1.33 KB
/
routes.php
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
<?php
use Controller\Home;
use Controller\User;
use Controller\Note;
use Controller\Archive;
use Core\App;
App::get('/', [Home::class, 'index'])
->name('Dashboard');
//Note
App::get('/notes', [Note::class, 'index'])
->only('auth')
->name('Notes');
App::get('/note', [Note::class, 'show'])
->only('auth');
//Create a note
App::get('/create', [Note::class, 'create'])
->only('auth')
->name('Create');
App::post('/create', [Note::class, 'store'])
->only('auth');
//Edit a note
App::get('/edit', [Note::class, 'edit'])
->only('auth');
App::post('/edit', [Note::class, 'update'])
->name('Edit')
->only('auth');
//Remove a note
App::post('/remove', [Note::class, 'destroy'])
->name('Remove')
->only('auth');
//Archive a note
App::get('/archive', [Archive::class, 'index'])
->only('auth')
->name('Archive');
App::post('/archive', [Archive::class, 'store'])
->only('auth');
//Auth section
App::get('/login', [User::class, 'login'])
->only('guest');
App::get('/register', [User::class, 'register'])
->only('guest');
App::post('/login', [User::class, 'auth'])
->name('post-login')
->only('guest');
App::post('/register', [User::class, 'create'])
->name('post-register')
->only('guest');
App::post('/logout', [User::class, 'destroy'])
->name('logout')
->only('auth');