@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | return [ |
12 | 12 | |
13 | - /* |
|
13 | + /* |
|
14 | 14 | |------------------------------------------------------------------------------- |
15 | 15 | | Learning Locker (LRS) Settings |
16 | 16 | |------------------------------------------------------------------------------- |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | | |
22 | 22 | */ |
23 | 23 | |
24 | - 'learning-locker' => [ |
|
24 | + 'learning-locker' => [ |
|
25 | 25 | |
26 | 26 | /* |
27 | 27 | |--------------------------------------------------------------------------- |
@@ -39,39 +39,39 @@ discard block |
||
39 | 39 | |
40 | 40 | 'connection' => [ |
41 | 41 | |
42 | - /* |
|
42 | + /* |
|
43 | 43 | |-------------------------------------------------------------------------- |
44 | 44 | | Primary Learning Locker Connection |
45 | 45 | |-------------------------------------------------------------------------- |
46 | 46 | | |
47 | 47 | */ |
48 | 48 | |
49 | - 'primary' => [ |
|
49 | + 'primary' => [ |
|
50 | 50 | 'url' => env('LEARNING_LOCKER_URL'), |
51 | 51 | 'key' => env('LEARNING_LOCKER_KEY'), |
52 | 52 | 'secret' => env('LEARNING_LOCKER_SECRET'), |
53 | - ], |
|
53 | + ], |
|
54 | 54 | |
55 | 55 | |
56 | - /* |
|
56 | + /* |
|
57 | 57 | |-------------------------------------------------------------------------- |
58 | 58 | | Secondary Learning Locker Connection |
59 | 59 | |-------------------------------------------------------------------------- |
60 | 60 | | |
61 | 61 | */ |
62 | 62 | |
63 | - 'secondary' => [ |
|
63 | + 'secondary' => [ |
|
64 | 64 | 'url' => env('BACKUP_LEARNING_LOCKER_URL'), |
65 | 65 | 'key' => env('BACKUP_LEARNING_LOCKER_KEY'), |
66 | 66 | 'secret' => env('BACKUP_LEARNING_LOCKER_SECRET'), |
67 | - ], |
|
67 | + ], |
|
68 | 68 | |
69 | 69 | ], |
70 | 70 | |
71 | - ], |
|
71 | + ], |
|
72 | 72 | |
73 | 73 | |
74 | - /* |
|
74 | + /* |
|
75 | 75 | |------------------------------------------------------------------------------- |
76 | 76 | | Laravel Framework Settings |
77 | 77 | |------------------------------------------------------------------------------- |
@@ -80,19 +80,19 @@ discard block |
||
80 | 80 | | |
81 | 81 | */ |
82 | 82 | |
83 | - 'laravel' => [ |
|
83 | + 'laravel' => [ |
|
84 | 84 | 'settings' => [ |
85 | - 'queue' => false, |
|
86 | - 'export' => false, |
|
85 | + 'queue' => false, |
|
86 | + 'export' => false, |
|
87 | 87 | ], |
88 | 88 | 'route' => [ |
89 | - 'api' => [ |
|
89 | + 'api' => [ |
|
90 | 90 | 'prefix' => 'laralocker', |
91 | - ], |
|
92 | - 'web' => [ |
|
91 | + ], |
|
92 | + 'web' => [ |
|
93 | 93 | 'prefix' => 'laralocker', |
94 | - ], |
|
94 | + ], |
|
95 | + ], |
|
95 | 96 | ], |
96 | - ], |
|
97 | 97 | |
98 | 98 | ]; |
@@ -25,7 +25,7 @@ |
||
25 | 25 | */ |
26 | 26 | public function show($id) |
27 | 27 | { |
28 | - $select = ["_id"]; |
|
28 | + $select = [ "_id" ]; |
|
29 | 29 | return LearningLocker::client($id)->get($select); |
30 | 30 | } |
31 | 31 |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | */ |
15 | 15 | public function index() |
16 | 16 | { |
17 | - return LearningLocker::personas()->get(); |
|
17 | + return LearningLocker::personas()->get(); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function show($id) |
27 | 27 | { |
28 | - return LearningLocker::persona($id)->get(); |
|
28 | + return LearningLocker::persona($id)->get(); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -25,7 +25,7 @@ |
||
25 | 25 | */ |
26 | 26 | public function show($id) |
27 | 27 | { |
28 | - $selectables = ["_id"]; |
|
28 | + $selectables = [ "_id" ]; |
|
29 | 29 | return LearningLocker::store($id)->get($selectables); |
30 | 30 | } |
31 | 31 |
@@ -12,142 +12,142 @@ |
||
12 | 12 | |
13 | 13 | Route::group(['prefix' => 'laralocker'], function () { |
14 | 14 | |
15 | - $controller_namespace = "\Ijeffro\Laralocker\Controllers\\"; |
|
16 | - |
|
17 | - // Aggregation |
|
18 | - // Route::post('aggregation', $controller_namespace . 'AggregationController@save')->name('learning_locker.post.aggregation'); |
|
19 | - |
|
20 | - // Client |
|
21 | - Route::get('clients', $controller_namespace . 'ClientController@index')->name('learning_locker.list.clients'); |
|
22 | - Route::get('clients/{id}', $controller_namespace . 'ClientController@show')->name('learning_locker.get.client'); |
|
23 | - Route::post('clients', $controller_namespace . 'ClientController@save')->name('learning_locker.create.client'); |
|
24 | - Route::patch('clients/{id}', $controller_namespace . 'ClientController@update')->name('learning_locker.update.client'); |
|
25 | - Route::delete('clients/{id}', $controller_namespace . 'ClientController@destroy')->name('learning_locker.delete.client'); |
|
26 | - |
|
27 | - // Client |
|
28 | - Route::get('clients', $controller_namespace . 'ClientController@index')->name('learning_locker.list.clients'); |
|
29 | - Route::get('clients/{id}', $controller_namespace . 'ClientController@show')->name('learning_locker.get.client'); |
|
30 | - Route::post('clients', $controller_namespace . 'ClientController@save')->name('learning_locker.create.client'); |
|
31 | - Route::patch('clients/{id}', $controller_namespace . 'ClientController@update')->name('learning_locker.update.client'); |
|
32 | - Route::delete('clients/{id}', $controller_namespace . 'ClientController@destroy')->name('learning_locker.delete.client'); |
|
33 | - |
|
34 | - // Dashboard |
|
35 | - Route::get('dashboards', $controller_namespace . 'DashboardController@index')->name('learning_locker.list.dashboards'); |
|
36 | - Route::get('dashboards/{id}', $controller_namespace . 'DashboardController@show')->name('learning_locker.get.dashboard'); |
|
37 | - Route::post('dashboards', $controller_namespace . 'DashboardController@save')->name('learning_locker.create.dashboard'); |
|
38 | - Route::patch('dashboards/{id}', $controller_namespace . 'DashboardController@update')->name('learning_locker.update.dashboard'); |
|
39 | - Route::delete('dashboards/{id}', $controller_namespace . 'DashboardController@destroy')->name('learning_locker.delete.dashboard'); |
|
40 | - |
|
41 | - // Downloads |
|
42 | - Route::get('downloads', $controller_namespace . 'DownloadController@index')->name('learning_locker.list.downloads'); |
|
43 | - Route::get('downloads/{id}', $controller_namespace . 'DownloadController@show')->name('learning_locker.get.download'); |
|
44 | - Route::post('downloads', $controller_namespace . 'DownloadController@save')->name('learning_locker.create.download'); |
|
45 | - Route::patch('downloads/{id}', $controller_namespace . 'DownloadController@update')->name('learning_locker.update.download'); |
|
46 | - Route::delete('downloads/{id}', $controller_namespace . 'DownloadController@destroy')->name('learning_locker.delete.download'); |
|
47 | - |
|
48 | - // Exports |
|
49 | - Route::get('exports', $controller_namespace . 'ExportController@index')->name('learning_locker.list.exports'); |
|
50 | - Route::get('exports/{id}', $controller_namespace . 'ExportController@show')->name('learning_locker.get.export'); |
|
51 | - Route::post('exports', $controller_namespace . 'ExportController@save')->name('learning_locker.create.export'); |
|
52 | - Route::patch('exports/{id}', $controller_namespace . 'ExportController@update')->name('learning_locker.update.export'); |
|
53 | - Route::delete('exports/{id}', $controller_namespace . 'ExportController@destroy')->name('learning_locker.delete.export'); |
|
54 | - |
|
55 | - // Journeys |
|
56 | - Route::get('journeys', $controller_namespace . 'JourneyController@index')->name('learning_locker.list.journeys'); |
|
57 | - Route::get('journeys/{id}', $controller_namespace . 'JourneyController@show')->name('learning_locker.get.journey'); |
|
58 | - Route::post('journeys', $controller_namespace . 'JourneyController@save')->name('learning_locker.create.journey'); |
|
59 | - Route::patch('journeys/{id}', $controller_namespace . 'JourneyController@update')->name('learning_locker.update.journey'); |
|
60 | - Route::delete('journeys/{id}', $controller_namespace . 'JourneyController@destroy')->name('learning_locker.delete.journey'); |
|
61 | - |
|
62 | - // Journeys Progress |
|
63 | - Route::get('journeyprogress', $controller_namespace . 'JourneyProgressController@index')->name('learning_locker.list.journey.progress'); |
|
64 | - Route::get('journeyprogress/{id}', $controller_namespace . 'JourneyProgressController@show')->name('learning_locker.get.journey.progress'); |
|
65 | - Route::post('journeyprogress', $controller_namespace . 'JourneyProgressController@save')->name('learning_locker.create.journey.progress'); |
|
66 | - Route::patch('journeyprogress/{id}', $controller_namespace . 'JourneyProgressController@update')->name('learning_locker.update.journeyprogress'); |
|
67 | - Route::delete('journeyprogress/{id}', $controller_namespace . 'JourneyProgressController@destroy')->name('learning_locker.delete.journey.progress'); |
|
68 | - |
|
69 | - // Organisations |
|
70 | - Route::get('organisations', $controller_namespace . 'OrganisationController@index')->name('learning_locker.list.organisations'); |
|
71 | - Route::get('organisations/{id}', $controller_namespace . 'OrganisationController@show')->name('learning_locker.get.organisation'); |
|
72 | - Route::post('organisations', $controller_namespace . 'OrganisationController@save')->name('learning_locker.create.organisation'); |
|
73 | - Route::patch('organisations/{id}', $controller_namespace . 'OrganisationController@update')->name('learning_locker.update.organisation'); |
|
74 | - Route::delete('organisations/{id}', $controller_namespace . 'OrganisationController@destroy')->name('learning_locker.delete.organisation'); |
|
75 | - |
|
76 | - // Personas |
|
77 | - Route::get('personas', $controller_namespace . 'PersonaController@index')->name('learning_locker.list.personas'); |
|
78 | - Route::get('personas/{id}', $controller_namespace . 'PersonaController@show')->name('learning_locker.get.persona'); |
|
79 | - Route::post('personas', $controller_namespace . 'PersonaController@save')->name('learning_locker.create.persona'); |
|
80 | - Route::patch('personas/{id}', $controller_namespace . 'PersonaController@update')->name('learning_locker.update.persona'); |
|
81 | - Route::delete('personas/{id}', $controller_namespace . 'PersonaController@destroy')->name('learning_locker.delete.persona'); |
|
82 | - |
|
83 | - // Personas Identifiers |
|
84 | - // TODO |
|
85 | - |
|
86 | - // Personas Attributes |
|
87 | - // TODO |
|
88 | - |
|
89 | - // Query |
|
90 | - Route::get('query', $controller_namespace . 'QueryController@index')->name('learning_locker.list.queries'); |
|
91 | - Route::get('query/{id}', $controller_namespace . 'QueryController@show')->name('learning_locker.get.query'); |
|
92 | - Route::post('query', $controller_namespace . 'QueryController@save')->name('learning_locker.create.query'); |
|
93 | - Route::patch('query/{id}', $controller_namespace . 'QueryController@update')->name('learning_locker.update.query'); |
|
94 | - Route::delete('query/{id}', $controller_namespace . 'QueryController@destroy')->name('learning_locker.delete.query'); |
|
95 | - |
|
96 | - // Roles |
|
97 | - Route::get('roles', $controller_namespace . 'RoleController@index')->name('learning_locker.list.roles'); |
|
98 | - Route::get('roles/{id}', $controller_namespace . 'RoleController@show')->name('learning_locker.get.role'); |
|
99 | - Route::post('roles', $controller_namespace . 'RoleController@save')->name('learning_locker.create.role'); |
|
100 | - Route::patch('roles/{id}', $controller_namespace . 'RoleController@update')->name('learning_locker.update.role'); |
|
101 | - Route::delete('roles/{id}', $controller_namespace . 'RoleController@destroy')->name('learning_locker.delete.role'); |
|
102 | - |
|
103 | - // Statements |
|
104 | - Route::get('statements', $controller_namespace . 'StatementController@index')->name('learning_locker.list.statements'); |
|
105 | - Route::get('statements/{id}', $controller_namespace . 'StatementController@show')->name('learning_locker.get.statement'); |
|
106 | - Route::post('statements', $controller_namespace . 'StatementController@save')->name('learning_locker.create.statement'); |
|
107 | - Route::patch('statements/{id}', $controller_namespace . 'StatementController@update')->name('learning_locker.update.statement'); |
|
108 | - |
|
109 | - // Completion |
|
110 | - Route::post('completion', $controller_namespace . 'CompletionController@save')->name('receive.learning_locker.completion'); |
|
111 | - |
|
112 | - // Statement Deletion |
|
113 | - Route::delete('statement/{id}', $controller_namespace . 'StatementController@destroy')->name('learning_locker.delete.statement'); |
|
114 | - |
|
115 | - // Statement Forwarding |
|
116 | - Route::get('statementforwarding', $controller_namespace . 'StatementForwardingController@index')->name('learning_locker.list.statement.forward'); |
|
117 | - Route::get('statementforwarding/{id}', $controller_namespace . 'StatementForwardingController@show')->name('learning_locker.get.statement.forward'); |
|
118 | - Route::post('statementforwarding', $controller_namespace . 'StatementForwardingController@save')->name('learning_locker.create.statement.forward'); |
|
119 | - Route::patch('statementforwarding/{id}', $controller_namespace . 'StatementForwardingController@update')->name('learning_locker.update.statement.forward'); |
|
120 | - Route::delete('statementforwarding/{id}', $controller_namespace . 'StatementForwardingController@destroy')->name('learning_locker.delete.statement.forward'); |
|
121 | - |
|
122 | - // Stores |
|
123 | - Route::get('stores', $controller_namespace . 'StoreController@index')->name('learning_locker.list.stores'); |
|
124 | - Route::get('stores/{id}', $controller_namespace . 'StoreController@show')->name('learning_locker.get.store'); |
|
125 | - Route::post('stores', $controller_namespace . 'StoreController@save')->name('learning_locker.create.store'); |
|
126 | - Route::patch('stores/{id}', $controller_namespace . 'StoreController@update')->name('learning_locker.update.store'); |
|
127 | - Route::delete('stores/{id}', $controller_namespace . 'StoreController@destroy')->name('learning_locker.delete.store'); |
|
128 | - |
|
129 | - // Users |
|
130 | - Route::get('users', $controller_namespace . 'UserController@index')->name('learning_locker.list.users'); |
|
131 | - Route::get('users/{id}', $controller_namespace . 'UserController@show')->name('learning_locker.get.user'); |
|
132 | - Route::post('users', $controller_namespace . 'UserController@save')->name('learning_locker.create.user'); |
|
133 | - Route::patch('users/{id}', $controller_namespace . 'UserController@update')->name('learning_locker.update.user'); |
|
134 | - Route::delete('users/{id}', $controller_namespace . 'UserController@destroy')->name('learning_locker.delete.user'); |
|
135 | - |
|
136 | - // Visualisations |
|
137 | - Route::get('visualisations', $controller_namespace . 'VisualisationController@index')->name('learning_locker.list.visualisations'); |
|
138 | - Route::get('visualisations/{id}', $controller_namespace . 'VisualisationController@show')->name('learning_locker.get.visualisation'); |
|
139 | - Route::post('visualisations', $controller_namespace . 'VisualisationController@save')->name('learning_locker.create.visualisation'); |
|
140 | - Route::patch('visualisations/{id}', $controller_namespace . 'VisualisationController@update')->name('learning_locker.update.visualisation'); |
|
141 | - Route::delete('visualisations/{id}', $controller_namespace . 'VisualisationController@destroy')->name('learning_locker.delete.visualisation'); |
|
142 | - |
|
143 | - // Route::group(['prefix' => 'xapi'], function () { |
|
144 | - |
|
145 | - // // Visualisations |
|
146 | - // Route::get('about', $controller_namespace . 'VisualisationController@index')->name('learning_locker.list.visualisations'); |
|
147 | - // Route::get('visualisations/{id}', $controller_namespace . 'VisualisationController@show')->name('learning_locker.get.visualisation'); |
|
148 | - // Route::post('visualisations', $controller_namespace . 'VisualisationController@save')->name('learning_locker.create.visualisation'); |
|
149 | - // Route::patch('visualisations/{id}', $controller_namespace . 'VisualisationController@update')->name('learning_locker.update.visualisation'); |
|
150 | - // Route::delete('visualisations/{id}', $controller_namespace . 'VisualisationController@destroy')->name('learning_locker.delete.visualisation'); |
|
151 | - |
|
152 | - // }); |
|
15 | + $controller_namespace = "\Ijeffro\Laralocker\Controllers\\"; |
|
16 | + |
|
17 | + // Aggregation |
|
18 | + // Route::post('aggregation', $controller_namespace . 'AggregationController@save')->name('learning_locker.post.aggregation'); |
|
19 | + |
|
20 | + // Client |
|
21 | + Route::get('clients', $controller_namespace . 'ClientController@index')->name('learning_locker.list.clients'); |
|
22 | + Route::get('clients/{id}', $controller_namespace . 'ClientController@show')->name('learning_locker.get.client'); |
|
23 | + Route::post('clients', $controller_namespace . 'ClientController@save')->name('learning_locker.create.client'); |
|
24 | + Route::patch('clients/{id}', $controller_namespace . 'ClientController@update')->name('learning_locker.update.client'); |
|
25 | + Route::delete('clients/{id}', $controller_namespace . 'ClientController@destroy')->name('learning_locker.delete.client'); |
|
26 | + |
|
27 | + // Client |
|
28 | + Route::get('clients', $controller_namespace . 'ClientController@index')->name('learning_locker.list.clients'); |
|
29 | + Route::get('clients/{id}', $controller_namespace . 'ClientController@show')->name('learning_locker.get.client'); |
|
30 | + Route::post('clients', $controller_namespace . 'ClientController@save')->name('learning_locker.create.client'); |
|
31 | + Route::patch('clients/{id}', $controller_namespace . 'ClientController@update')->name('learning_locker.update.client'); |
|
32 | + Route::delete('clients/{id}', $controller_namespace . 'ClientController@destroy')->name('learning_locker.delete.client'); |
|
33 | + |
|
34 | + // Dashboard |
|
35 | + Route::get('dashboards', $controller_namespace . 'DashboardController@index')->name('learning_locker.list.dashboards'); |
|
36 | + Route::get('dashboards/{id}', $controller_namespace . 'DashboardController@show')->name('learning_locker.get.dashboard'); |
|
37 | + Route::post('dashboards', $controller_namespace . 'DashboardController@save')->name('learning_locker.create.dashboard'); |
|
38 | + Route::patch('dashboards/{id}', $controller_namespace . 'DashboardController@update')->name('learning_locker.update.dashboard'); |
|
39 | + Route::delete('dashboards/{id}', $controller_namespace . 'DashboardController@destroy')->name('learning_locker.delete.dashboard'); |
|
40 | + |
|
41 | + // Downloads |
|
42 | + Route::get('downloads', $controller_namespace . 'DownloadController@index')->name('learning_locker.list.downloads'); |
|
43 | + Route::get('downloads/{id}', $controller_namespace . 'DownloadController@show')->name('learning_locker.get.download'); |
|
44 | + Route::post('downloads', $controller_namespace . 'DownloadController@save')->name('learning_locker.create.download'); |
|
45 | + Route::patch('downloads/{id}', $controller_namespace . 'DownloadController@update')->name('learning_locker.update.download'); |
|
46 | + Route::delete('downloads/{id}', $controller_namespace . 'DownloadController@destroy')->name('learning_locker.delete.download'); |
|
47 | + |
|
48 | + // Exports |
|
49 | + Route::get('exports', $controller_namespace . 'ExportController@index')->name('learning_locker.list.exports'); |
|
50 | + Route::get('exports/{id}', $controller_namespace . 'ExportController@show')->name('learning_locker.get.export'); |
|
51 | + Route::post('exports', $controller_namespace . 'ExportController@save')->name('learning_locker.create.export'); |
|
52 | + Route::patch('exports/{id}', $controller_namespace . 'ExportController@update')->name('learning_locker.update.export'); |
|
53 | + Route::delete('exports/{id}', $controller_namespace . 'ExportController@destroy')->name('learning_locker.delete.export'); |
|
54 | + |
|
55 | + // Journeys |
|
56 | + Route::get('journeys', $controller_namespace . 'JourneyController@index')->name('learning_locker.list.journeys'); |
|
57 | + Route::get('journeys/{id}', $controller_namespace . 'JourneyController@show')->name('learning_locker.get.journey'); |
|
58 | + Route::post('journeys', $controller_namespace . 'JourneyController@save')->name('learning_locker.create.journey'); |
|
59 | + Route::patch('journeys/{id}', $controller_namespace . 'JourneyController@update')->name('learning_locker.update.journey'); |
|
60 | + Route::delete('journeys/{id}', $controller_namespace . 'JourneyController@destroy')->name('learning_locker.delete.journey'); |
|
61 | + |
|
62 | + // Journeys Progress |
|
63 | + Route::get('journeyprogress', $controller_namespace . 'JourneyProgressController@index')->name('learning_locker.list.journey.progress'); |
|
64 | + Route::get('journeyprogress/{id}', $controller_namespace . 'JourneyProgressController@show')->name('learning_locker.get.journey.progress'); |
|
65 | + Route::post('journeyprogress', $controller_namespace . 'JourneyProgressController@save')->name('learning_locker.create.journey.progress'); |
|
66 | + Route::patch('journeyprogress/{id}', $controller_namespace . 'JourneyProgressController@update')->name('learning_locker.update.journeyprogress'); |
|
67 | + Route::delete('journeyprogress/{id}', $controller_namespace . 'JourneyProgressController@destroy')->name('learning_locker.delete.journey.progress'); |
|
68 | + |
|
69 | + // Organisations |
|
70 | + Route::get('organisations', $controller_namespace . 'OrganisationController@index')->name('learning_locker.list.organisations'); |
|
71 | + Route::get('organisations/{id}', $controller_namespace . 'OrganisationController@show')->name('learning_locker.get.organisation'); |
|
72 | + Route::post('organisations', $controller_namespace . 'OrganisationController@save')->name('learning_locker.create.organisation'); |
|
73 | + Route::patch('organisations/{id}', $controller_namespace . 'OrganisationController@update')->name('learning_locker.update.organisation'); |
|
74 | + Route::delete('organisations/{id}', $controller_namespace . 'OrganisationController@destroy')->name('learning_locker.delete.organisation'); |
|
75 | + |
|
76 | + // Personas |
|
77 | + Route::get('personas', $controller_namespace . 'PersonaController@index')->name('learning_locker.list.personas'); |
|
78 | + Route::get('personas/{id}', $controller_namespace . 'PersonaController@show')->name('learning_locker.get.persona'); |
|
79 | + Route::post('personas', $controller_namespace . 'PersonaController@save')->name('learning_locker.create.persona'); |
|
80 | + Route::patch('personas/{id}', $controller_namespace . 'PersonaController@update')->name('learning_locker.update.persona'); |
|
81 | + Route::delete('personas/{id}', $controller_namespace . 'PersonaController@destroy')->name('learning_locker.delete.persona'); |
|
82 | + |
|
83 | + // Personas Identifiers |
|
84 | + // TODO |
|
85 | + |
|
86 | + // Personas Attributes |
|
87 | + // TODO |
|
88 | + |
|
89 | + // Query |
|
90 | + Route::get('query', $controller_namespace . 'QueryController@index')->name('learning_locker.list.queries'); |
|
91 | + Route::get('query/{id}', $controller_namespace . 'QueryController@show')->name('learning_locker.get.query'); |
|
92 | + Route::post('query', $controller_namespace . 'QueryController@save')->name('learning_locker.create.query'); |
|
93 | + Route::patch('query/{id}', $controller_namespace . 'QueryController@update')->name('learning_locker.update.query'); |
|
94 | + Route::delete('query/{id}', $controller_namespace . 'QueryController@destroy')->name('learning_locker.delete.query'); |
|
95 | + |
|
96 | + // Roles |
|
97 | + Route::get('roles', $controller_namespace . 'RoleController@index')->name('learning_locker.list.roles'); |
|
98 | + Route::get('roles/{id}', $controller_namespace . 'RoleController@show')->name('learning_locker.get.role'); |
|
99 | + Route::post('roles', $controller_namespace . 'RoleController@save')->name('learning_locker.create.role'); |
|
100 | + Route::patch('roles/{id}', $controller_namespace . 'RoleController@update')->name('learning_locker.update.role'); |
|
101 | + Route::delete('roles/{id}', $controller_namespace . 'RoleController@destroy')->name('learning_locker.delete.role'); |
|
102 | + |
|
103 | + // Statements |
|
104 | + Route::get('statements', $controller_namespace . 'StatementController@index')->name('learning_locker.list.statements'); |
|
105 | + Route::get('statements/{id}', $controller_namespace . 'StatementController@show')->name('learning_locker.get.statement'); |
|
106 | + Route::post('statements', $controller_namespace . 'StatementController@save')->name('learning_locker.create.statement'); |
|
107 | + Route::patch('statements/{id}', $controller_namespace . 'StatementController@update')->name('learning_locker.update.statement'); |
|
108 | + |
|
109 | + // Completion |
|
110 | + Route::post('completion', $controller_namespace . 'CompletionController@save')->name('receive.learning_locker.completion'); |
|
111 | + |
|
112 | + // Statement Deletion |
|
113 | + Route::delete('statement/{id}', $controller_namespace . 'StatementController@destroy')->name('learning_locker.delete.statement'); |
|
114 | + |
|
115 | + // Statement Forwarding |
|
116 | + Route::get('statementforwarding', $controller_namespace . 'StatementForwardingController@index')->name('learning_locker.list.statement.forward'); |
|
117 | + Route::get('statementforwarding/{id}', $controller_namespace . 'StatementForwardingController@show')->name('learning_locker.get.statement.forward'); |
|
118 | + Route::post('statementforwarding', $controller_namespace . 'StatementForwardingController@save')->name('learning_locker.create.statement.forward'); |
|
119 | + Route::patch('statementforwarding/{id}', $controller_namespace . 'StatementForwardingController@update')->name('learning_locker.update.statement.forward'); |
|
120 | + Route::delete('statementforwarding/{id}', $controller_namespace . 'StatementForwardingController@destroy')->name('learning_locker.delete.statement.forward'); |
|
121 | + |
|
122 | + // Stores |
|
123 | + Route::get('stores', $controller_namespace . 'StoreController@index')->name('learning_locker.list.stores'); |
|
124 | + Route::get('stores/{id}', $controller_namespace . 'StoreController@show')->name('learning_locker.get.store'); |
|
125 | + Route::post('stores', $controller_namespace . 'StoreController@save')->name('learning_locker.create.store'); |
|
126 | + Route::patch('stores/{id}', $controller_namespace . 'StoreController@update')->name('learning_locker.update.store'); |
|
127 | + Route::delete('stores/{id}', $controller_namespace . 'StoreController@destroy')->name('learning_locker.delete.store'); |
|
128 | + |
|
129 | + // Users |
|
130 | + Route::get('users', $controller_namespace . 'UserController@index')->name('learning_locker.list.users'); |
|
131 | + Route::get('users/{id}', $controller_namespace . 'UserController@show')->name('learning_locker.get.user'); |
|
132 | + Route::post('users', $controller_namespace . 'UserController@save')->name('learning_locker.create.user'); |
|
133 | + Route::patch('users/{id}', $controller_namespace . 'UserController@update')->name('learning_locker.update.user'); |
|
134 | + Route::delete('users/{id}', $controller_namespace . 'UserController@destroy')->name('learning_locker.delete.user'); |
|
135 | + |
|
136 | + // Visualisations |
|
137 | + Route::get('visualisations', $controller_namespace . 'VisualisationController@index')->name('learning_locker.list.visualisations'); |
|
138 | + Route::get('visualisations/{id}', $controller_namespace . 'VisualisationController@show')->name('learning_locker.get.visualisation'); |
|
139 | + Route::post('visualisations', $controller_namespace . 'VisualisationController@save')->name('learning_locker.create.visualisation'); |
|
140 | + Route::patch('visualisations/{id}', $controller_namespace . 'VisualisationController@update')->name('learning_locker.update.visualisation'); |
|
141 | + Route::delete('visualisations/{id}', $controller_namespace . 'VisualisationController@destroy')->name('learning_locker.delete.visualisation'); |
|
142 | + |
|
143 | + // Route::group(['prefix' => 'xapi'], function () { |
|
144 | + |
|
145 | + // // Visualisations |
|
146 | + // Route::get('about', $controller_namespace . 'VisualisationController@index')->name('learning_locker.list.visualisations'); |
|
147 | + // Route::get('visualisations/{id}', $controller_namespace . 'VisualisationController@show')->name('learning_locker.get.visualisation'); |
|
148 | + // Route::post('visualisations', $controller_namespace . 'VisualisationController@save')->name('learning_locker.create.visualisation'); |
|
149 | + // Route::patch('visualisations/{id}', $controller_namespace . 'VisualisationController@update')->name('learning_locker.update.visualisation'); |
|
150 | + // Route::delete('visualisations/{id}', $controller_namespace . 'VisualisationController@destroy')->name('learning_locker.delete.visualisation'); |
|
151 | + |
|
152 | + // }); |
|
153 | 153 | }); |
@@ -10,7 +10,7 @@ |
||
10 | 10 | | |
11 | 11 | */ |
12 | 12 | |
13 | -Route::group(['prefix' => 'laralocker'], function () { |
|
13 | +Route::group([ 'prefix' => 'laralocker' ], function() { |
|
14 | 14 | |
15 | 15 | $controller_namespace = "\Ijeffro\Laralocker\Controllers\\"; |
16 | 16 |
@@ -6,105 +6,105 @@ |
||
6 | 6 | |
7 | 7 | class StoreHandler extends APIHandler { |
8 | 8 | |
9 | - /** |
|
10 | - * Learning Locker Conection Details |
|
11 | - * |
|
12 | - * @param string|null $id |
|
13 | - * @param string|null $key |
|
14 | - * @param string|null $secret |
|
15 | - * @param string|null $url |
|
16 | - * |
|
17 | - * @return void |
|
18 | - */ |
|
19 | - public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | - { |
|
9 | + /** |
|
10 | + * Learning Locker Conection Details |
|
11 | + * |
|
12 | + * @param string|null $id |
|
13 | + * @param string|null $key |
|
14 | + * @param string|null $secret |
|
15 | + * @param string|null $url |
|
16 | + * |
|
17 | + * @return void |
|
18 | + */ |
|
19 | + public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | + { |
|
21 | 21 | $this->id = $id ? (string) $id : null; |
22 | 22 | $this->key = $key ? (string) $key : null; |
23 | 23 | $this->secret = $secret ? (string) $secret : null; |
24 | 24 | $this->url = $url ? (string) $url : null; |
25 | 25 | |
26 | 26 | parent::__construct($this->key, $this->secret, $this->url); |
27 | - } |
|
27 | + } |
|
28 | 28 | |
29 | - private $store = '/lrs'; |
|
30 | - private $api = '/api'; |
|
31 | - private $v2 = '/v2'; |
|
29 | + private $store = '/lrs'; |
|
30 | + private $api = '/api'; |
|
31 | + private $v2 = '/v2'; |
|
32 | 32 | |
33 | - protected $headers = [ |
|
33 | + protected $headers = [ |
|
34 | 34 | 'Accept' => 'application/json', |
35 | 35 | 'Content-Type' => 'application/json' |
36 | - ]; |
|
36 | + ]; |
|
37 | 37 | |
38 | 38 | |
39 | - /** |
|
40 | - * Construct the Learning Locker URL |
|
41 | - * |
|
42 | - * @param string|null $id |
|
43 | - * @return string |
|
44 | - */ |
|
45 | - public function url(string $id = null) { |
|
39 | + /** |
|
40 | + * Construct the Learning Locker URL |
|
41 | + * |
|
42 | + * @param string|null $id |
|
43 | + * @return string |
|
44 | + */ |
|
45 | + public function url(string $id = null) { |
|
46 | 46 | return implode('/', [trim($this->url . $this->api . $this->v2 . $this->store, '/'), $id ?? $id]); |
47 | - } |
|
48 | - |
|
49 | - /** |
|
50 | - * Learning Locker: Get Clients |
|
51 | - * |
|
52 | - * @param array $selected |
|
53 | - * @return object $response |
|
54 | - */ |
|
55 | - public function get(array $selected = []) { |
|
47 | + } |
|
48 | + |
|
49 | + /** |
|
50 | + * Learning Locker: Get Clients |
|
51 | + * |
|
52 | + * @param array $selected |
|
53 | + * @return object $response |
|
54 | + */ |
|
55 | + public function get(array $selected = []) { |
|
56 | 56 | try { |
57 | - $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
|
57 | + $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
|
58 | 58 | |
59 | - if ($selected) $response = $this->select($selected, $response); |
|
59 | + if ($selected) $response = $this->select($selected, $response); |
|
60 | 60 | |
61 | - return $response; |
|
61 | + return $response; |
|
62 | 62 | } catch (Exception $e) { |
63 | - Log::error('Getting Client: ' . $e); |
|
63 | + Log::error('Getting Client: ' . $e); |
|
64 | 64 | } |
65 | - } |
|
66 | - |
|
67 | - /** |
|
68 | - * Learning Locker: Update Client |
|
69 | - * |
|
70 | - * @return $response |
|
71 | - */ |
|
72 | - public function update($data) { |
|
65 | + } |
|
66 | + |
|
67 | + /** |
|
68 | + * Learning Locker: Update Client |
|
69 | + * |
|
70 | + * @return $response |
|
71 | + */ |
|
72 | + public function update($data) { |
|
73 | 73 | try { |
74 | - $response = $this->patchToLearningLocker($this->url($this->id ?? $this->id), $data); |
|
74 | + $response = $this->patchToLearningLocker($this->url($this->id ?? $this->id), $data); |
|
75 | 75 | |
76 | - return $response; |
|
76 | + return $response; |
|
77 | 77 | } catch (Exception $e) { |
78 | - Log::error('Updating Client: ' . $e, array('context' => $data)); |
|
78 | + Log::error('Updating Client: ' . $e, array('context' => $data)); |
|
79 | 79 | } |
80 | - } |
|
81 | - |
|
82 | - /** |
|
83 | - * Learning Locker: Delete Client |
|
84 | - * |
|
85 | - * @return $response |
|
86 | - */ |
|
87 | - public function delete() { |
|
80 | + } |
|
81 | + |
|
82 | + /** |
|
83 | + * Learning Locker: Delete Client |
|
84 | + * |
|
85 | + * @return $response |
|
86 | + */ |
|
87 | + public function delete() { |
|
88 | 88 | try { |
89 | - $response = $this->deleteFromLearningLocker($this->url($this->id)); |
|
90 | - return $response; |
|
89 | + $response = $this->deleteFromLearningLocker($this->url($this->id)); |
|
90 | + return $response; |
|
91 | 91 | } catch (Exception $e) { |
92 | - Log::error('Deleting Client: ' . $e); |
|
92 | + Log::error('Deleting Client: ' . $e); |
|
93 | + } |
|
93 | 94 | } |
94 | - } |
|
95 | - |
|
96 | - /** |
|
97 | - * Learning Locker: Create Client |
|
98 | - * |
|
99 | - * @return $response |
|
100 | - */ |
|
101 | - public function create($data = null) { |
|
95 | + |
|
96 | + /** |
|
97 | + * Learning Locker: Create Client |
|
98 | + * |
|
99 | + * @return $response |
|
100 | + */ |
|
101 | + public function create($data = null) { |
|
102 | 102 | try { |
103 | - $response = $this->postToLearningLocker($this->url(), $data); |
|
104 | - return $response; |
|
103 | + $response = $this->postToLearningLocker($this->url(), $data); |
|
104 | + return $response; |
|
105 | 105 | } catch (Exception $e) { |
106 | - Log::error('Creating Client: ' . $e, array('context' => $data)); |
|
106 | + Log::error('Creating Client: ' . $e, array('context' => $data)); |
|
107 | + } |
|
107 | 108 | } |
108 | - } |
|
109 | 109 | |
110 | 110 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @return string |
44 | 44 | */ |
45 | 45 | public function url(string $id = null) { |
46 | - return implode('/', [trim($this->url . $this->api . $this->v2 . $this->store, '/'), $id ?? $id]); |
|
46 | + return implode('/', [ trim($this->url . $this->api . $this->v2 . $this->store, '/'), $id ?? $id ]); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * @param array $selected |
53 | 53 | * @return object $response |
54 | 54 | */ |
55 | - public function get(array $selected = []) { |
|
55 | + public function get(array $selected = [ ]) { |
|
56 | 56 | try { |
57 | 57 | $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
58 | 58 |
@@ -56,7 +56,9 @@ |
||
56 | 56 | try { |
57 | 57 | $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
58 | 58 | |
59 | - if ($selected) $response = $this->select($selected, $response); |
|
59 | + if ($selected) { |
|
60 | + $response = $this->select($selected, $response); |
|
61 | + } |
|
60 | 62 | |
61 | 63 | return $response; |
62 | 64 | } catch (Exception $e) { |
@@ -6,104 +6,104 @@ |
||
6 | 6 | |
7 | 7 | class DashboardHandler extends APIHandler { |
8 | 8 | |
9 | - /** |
|
10 | - * Learning Locker Conection Details |
|
11 | - * |
|
12 | - * @param string|null $id |
|
13 | - * @param string|null $key |
|
14 | - * @param string|null $secret |
|
15 | - * @param string|null $url |
|
16 | - * |
|
17 | - * @return void |
|
18 | - */ |
|
19 | - public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | - { |
|
9 | + /** |
|
10 | + * Learning Locker Conection Details |
|
11 | + * |
|
12 | + * @param string|null $id |
|
13 | + * @param string|null $key |
|
14 | + * @param string|null $secret |
|
15 | + * @param string|null $url |
|
16 | + * |
|
17 | + * @return void |
|
18 | + */ |
|
19 | + public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | + { |
|
21 | 21 | $this->id = $id ? (string) $id : null; |
22 | 22 | $this->key = $key ? (string) $key : null; |
23 | 23 | $this->secret = $secret ? (string) $secret : null; |
24 | 24 | $this->url = $url ? (string) $url : null; |
25 | 25 | |
26 | 26 | parent::__construct($this->key, $this->secret, $this->url); |
27 | - } |
|
27 | + } |
|
28 | 28 | |
29 | - private $dashboard = '/dashboard'; |
|
30 | - private $api = '/api'; |
|
31 | - private $v2 = '/v2'; |
|
29 | + private $dashboard = '/dashboard'; |
|
30 | + private $api = '/api'; |
|
31 | + private $v2 = '/v2'; |
|
32 | 32 | |
33 | - protected $headers = [ |
|
33 | + protected $headers = [ |
|
34 | 34 | 'Content-Type' => 'application/json' |
35 | - ]; |
|
35 | + ]; |
|
36 | 36 | |
37 | 37 | |
38 | - /** |
|
39 | - * Construct the Learning Locker URL |
|
40 | - * |
|
41 | - * @param string|null $id |
|
42 | - * @return string |
|
43 | - */ |
|
44 | - public function url(string $id = null) { |
|
38 | + /** |
|
39 | + * Construct the Learning Locker URL |
|
40 | + * |
|
41 | + * @param string|null $id |
|
42 | + * @return string |
|
43 | + */ |
|
44 | + public function url(string $id = null) { |
|
45 | 45 | return implode('/', [trim($this->url . $this->api . $this->v2 . $this->dashboard, '/'), $id ?? $id]); |
46 | - } |
|
47 | - |
|
48 | - /** |
|
49 | - * Learning Locker: Get Dashboards |
|
50 | - * |
|
51 | - * @param array $selected |
|
52 | - * @return object $response |
|
53 | - */ |
|
54 | - public function get(array $selected = []) { |
|
46 | + } |
|
47 | + |
|
48 | + /** |
|
49 | + * Learning Locker: Get Dashboards |
|
50 | + * |
|
51 | + * @param array $selected |
|
52 | + * @return object $response |
|
53 | + */ |
|
54 | + public function get(array $selected = []) { |
|
55 | 55 | try { |
56 | - $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
|
56 | + $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
|
57 | 57 | |
58 | - if ($selected) $response = $this->select($selected, $response); |
|
58 | + if ($selected) $response = $this->select($selected, $response); |
|
59 | 59 | |
60 | - return $response; |
|
60 | + return $response; |
|
61 | 61 | } catch (Exception $e) { |
62 | - return $e; |
|
62 | + return $e; |
|
63 | 63 | } |
64 | - } |
|
65 | - |
|
66 | - /** |
|
67 | - * Learning Locker: Update Dashboard |
|
68 | - * |
|
69 | - * @return $response |
|
70 | - */ |
|
71 | - public function update($data) { |
|
64 | + } |
|
65 | + |
|
66 | + /** |
|
67 | + * Learning Locker: Update Dashboard |
|
68 | + * |
|
69 | + * @return $response |
|
70 | + */ |
|
71 | + public function update($data) { |
|
72 | 72 | try { |
73 | - $response = $this->patchToLearningLocker($this->url($this->id ?? $this->id), $data); |
|
73 | + $response = $this->patchToLearningLocker($this->url($this->id ?? $this->id), $data); |
|
74 | 74 | |
75 | - return $response; |
|
75 | + return $response; |
|
76 | 76 | } catch (Exception $e) { |
77 | - return $e; |
|
77 | + return $e; |
|
78 | 78 | } |
79 | - } |
|
80 | - |
|
81 | - /** |
|
82 | - * Learning Locker: Delete Dashboard |
|
83 | - * |
|
84 | - * @return $response |
|
85 | - */ |
|
86 | - public function delete() { |
|
79 | + } |
|
80 | + |
|
81 | + /** |
|
82 | + * Learning Locker: Delete Dashboard |
|
83 | + * |
|
84 | + * @return $response |
|
85 | + */ |
|
86 | + public function delete() { |
|
87 | 87 | try { |
88 | - $response = $this->deleteFromLearningLocker($this->url($this->id)); |
|
89 | - return $response; |
|
88 | + $response = $this->deleteFromLearningLocker($this->url($this->id)); |
|
89 | + return $response; |
|
90 | 90 | } catch (Exception $e) { |
91 | - return $e; |
|
91 | + return $e; |
|
92 | + } |
|
92 | 93 | } |
93 | - } |
|
94 | - |
|
95 | - /** |
|
96 | - * Learning Locker: Create Dashboard |
|
97 | - * |
|
98 | - * @return $response |
|
99 | - */ |
|
100 | - public function create($data = null) { |
|
94 | + |
|
95 | + /** |
|
96 | + * Learning Locker: Create Dashboard |
|
97 | + * |
|
98 | + * @return $response |
|
99 | + */ |
|
100 | + public function create($data = null) { |
|
101 | 101 | try { |
102 | - $response = $this->postToLearningLocker($this->url(), $data); |
|
103 | - return $response; |
|
102 | + $response = $this->postToLearningLocker($this->url(), $data); |
|
103 | + return $response; |
|
104 | 104 | } catch (Exception $e) { |
105 | - Log::error('Creating Dashboard: ' . $e, array('context' => $data)); |
|
105 | + Log::error('Creating Dashboard: ' . $e, array('context' => $data)); |
|
106 | + } |
|
106 | 107 | } |
107 | - } |
|
108 | 108 | |
109 | 109 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * @return string |
43 | 43 | */ |
44 | 44 | public function url(string $id = null) { |
45 | - return implode('/', [trim($this->url . $this->api . $this->v2 . $this->dashboard, '/'), $id ?? $id]); |
|
45 | + return implode('/', [ trim($this->url . $this->api . $this->v2 . $this->dashboard, '/'), $id ?? $id ]); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * @param array $selected |
52 | 52 | * @return object $response |
53 | 53 | */ |
54 | - public function get(array $selected = []) { |
|
54 | + public function get(array $selected = [ ]) { |
|
55 | 55 | try { |
56 | 56 | $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
57 | 57 |
@@ -55,7 +55,9 @@ |
||
55 | 55 | try { |
56 | 56 | $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
57 | 57 | |
58 | - if ($selected) $response = $this->select($selected, $response); |
|
58 | + if ($selected) { |
|
59 | + $response = $this->select($selected, $response); |
|
60 | + } |
|
59 | 61 | |
60 | 62 | return $response; |
61 | 63 | } catch (Exception $e) { |
@@ -7,106 +7,106 @@ |
||
7 | 7 | |
8 | 8 | class ClientHandler extends APIHandler { |
9 | 9 | |
10 | - /** |
|
11 | - * Learning Locker Conection Details |
|
12 | - * |
|
13 | - * @param string|null $id |
|
14 | - * @param string|null $key |
|
15 | - * @param string|null $secret |
|
16 | - * @param string|null $url |
|
17 | - * |
|
18 | - * @return void |
|
19 | - */ |
|
20 | - public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
21 | - { |
|
10 | + /** |
|
11 | + * Learning Locker Conection Details |
|
12 | + * |
|
13 | + * @param string|null $id |
|
14 | + * @param string|null $key |
|
15 | + * @param string|null $secret |
|
16 | + * @param string|null $url |
|
17 | + * |
|
18 | + * @return void |
|
19 | + */ |
|
20 | + public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
21 | + { |
|
22 | 22 | $this->id = $id ? (string) $id : null; |
23 | 23 | $this->key = $key ? (string) $key : null; |
24 | 24 | $this->secret = $secret ? (string) $secret : null; |
25 | 25 | $this->url = $url ? (string) $url : null; |
26 | 26 | |
27 | 27 | parent::__construct($this->key, $this->secret, $this->url); |
28 | - } |
|
28 | + } |
|
29 | 29 | |
30 | 30 | |
31 | - private $client = '/client'; |
|
32 | - private $api = '/api'; |
|
33 | - private $v2 = '/v2'; |
|
31 | + private $client = '/client'; |
|
32 | + private $api = '/api'; |
|
33 | + private $v2 = '/v2'; |
|
34 | 34 | |
35 | - protected $headers = [ |
|
35 | + protected $headers = [ |
|
36 | 36 | 'Accept' => 'application/json', |
37 | 37 | 'Content-Type' => 'application/json' |
38 | - ]; |
|
38 | + ]; |
|
39 | 39 | |
40 | 40 | |
41 | - /** |
|
42 | - * Construct the Learning Locker URL |
|
43 | - * |
|
44 | - * @param string|null $id |
|
45 | - * @return string |
|
46 | - */ |
|
47 | - public function url(string $id = null) { |
|
41 | + /** |
|
42 | + * Construct the Learning Locker URL |
|
43 | + * |
|
44 | + * @param string|null $id |
|
45 | + * @return string |
|
46 | + */ |
|
47 | + public function url(string $id = null) { |
|
48 | 48 | return implode('/', [trim($this->url . $this->api . $this->v2 . $this->client, '/'), $id ?? $id]); |
49 | - } |
|
50 | - |
|
51 | - /** |
|
52 | - * Learning Locker: Get Clients |
|
53 | - * |
|
54 | - * @param array $selected |
|
55 | - * @return object $response |
|
56 | - */ |
|
57 | - public function get(array $selected = []) { |
|
49 | + } |
|
50 | + |
|
51 | + /** |
|
52 | + * Learning Locker: Get Clients |
|
53 | + * |
|
54 | + * @param array $selected |
|
55 | + * @return object $response |
|
56 | + */ |
|
57 | + public function get(array $selected = []) { |
|
58 | 58 | try { |
59 | - if ($selected) { |
|
59 | + if ($selected) { |
|
60 | 60 | return $this->select($selected, |
61 | - $this->getFromLearningLocker( |
|
61 | + $this->getFromLearningLocker( |
|
62 | 62 | $this->url($this->id ?? $this->id) |
63 | - ) |
|
63 | + ) |
|
64 | 64 | ); |
65 | - } |
|
65 | + } |
|
66 | 66 | |
67 | - return $this->getFromLearningLocker($this->url($this->id ?? $this->id));; |
|
67 | + return $this->getFromLearningLocker($this->url($this->id ?? $this->id));; |
|
68 | 68 | } catch (Exception $e) { |
69 | - Log::error('Getting Client: ' . $e); |
|
69 | + Log::error('Getting Client: ' . $e); |
|
70 | 70 | } |
71 | - } |
|
72 | - |
|
73 | - /** |
|
74 | - * Learning Locker: Update Client |
|
75 | - * |
|
76 | - * @return $response |
|
77 | - */ |
|
78 | - public function update($data) { |
|
71 | + } |
|
72 | + |
|
73 | + /** |
|
74 | + * Learning Locker: Update Client |
|
75 | + * |
|
76 | + * @return $response |
|
77 | + */ |
|
78 | + public function update($data) { |
|
79 | 79 | try { |
80 | - return $this->patchToLearningLocker($this->url($this->id ?? $this->id), $data);; |
|
80 | + return $this->patchToLearningLocker($this->url($this->id ?? $this->id), $data);; |
|
81 | 81 | } catch (Exception $e) { |
82 | - Log::error('Updating Client: ' . $e, array('context' => $data)); |
|
82 | + Log::error('Updating Client: ' . $e, array('context' => $data)); |
|
83 | 83 | } |
84 | - } |
|
85 | - |
|
86 | - /** |
|
87 | - * Learning Locker: Delete Client |
|
88 | - * |
|
89 | - * @return $response |
|
90 | - */ |
|
91 | - public function delete() { |
|
84 | + } |
|
85 | + |
|
86 | + /** |
|
87 | + * Learning Locker: Delete Client |
|
88 | + * |
|
89 | + * @return $response |
|
90 | + */ |
|
91 | + public function delete() { |
|
92 | 92 | try { |
93 | - return $this->deleteFromLearningLocker($this->url($this->id)); |
|
93 | + return $this->deleteFromLearningLocker($this->url($this->id)); |
|
94 | 94 | } catch (Exception $e) { |
95 | - Log::error('Deleting Client: ' . $e); |
|
95 | + Log::error('Deleting Client: ' . $e); |
|
96 | + } |
|
96 | 97 | } |
97 | - } |
|
98 | - |
|
99 | - /** |
|
100 | - * Learning Locker: Create Client |
|
101 | - * |
|
102 | - * @return $response |
|
103 | - */ |
|
104 | - public function create($data = null) { |
|
98 | + |
|
99 | + /** |
|
100 | + * Learning Locker: Create Client |
|
101 | + * |
|
102 | + * @return $response |
|
103 | + */ |
|
104 | + public function create($data = null) { |
|
105 | 105 | try { |
106 | - return $this->postToLearningLocker($this->url(), $data);; |
|
106 | + return $this->postToLearningLocker($this->url(), $data);; |
|
107 | 107 | } catch (Exception $e) { |
108 | - Log::error('Creating Client: ' . $e, array('context' => $data)); |
|
108 | + Log::error('Creating Client: ' . $e, array('context' => $data)); |
|
109 | + } |
|
109 | 110 | } |
110 | - } |
|
111 | 111 | |
112 | 112 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @return string |
46 | 46 | */ |
47 | 47 | public function url(string $id = null) { |
48 | - return implode('/', [trim($this->url . $this->api . $this->v2 . $this->client, '/'), $id ?? $id]); |
|
48 | + return implode('/', [ trim($this->url . $this->api . $this->v2 . $this->client, '/'), $id ?? $id ]); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @param array $selected |
55 | 55 | * @return object $response |
56 | 56 | */ |
57 | - public function get(array $selected = []) { |
|
57 | + public function get(array $selected = [ ]) { |
|
58 | 58 | try { |
59 | 59 | if ($selected) { |
60 | 60 | return $this->select($selected, |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | ); |
65 | 65 | } |
66 | 66 | |
67 | - return $this->getFromLearningLocker($this->url($this->id ?? $this->id));; |
|
67 | + return $this->getFromLearningLocker($this->url($this->id ?? $this->id)); ; |
|
68 | 68 | } catch (Exception $e) { |
69 | 69 | Log::error('Getting Client: ' . $e); |
70 | 70 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function update($data) { |
79 | 79 | try { |
80 | - return $this->patchToLearningLocker($this->url($this->id ?? $this->id), $data);; |
|
80 | + return $this->patchToLearningLocker($this->url($this->id ?? $this->id), $data); ; |
|
81 | 81 | } catch (Exception $e) { |
82 | 82 | Log::error('Updating Client: ' . $e, array('context' => $data)); |
83 | 83 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function create($data = null) { |
105 | 105 | try { |
106 | - return $this->postToLearningLocker($this->url(), $data);; |
|
106 | + return $this->postToLearningLocker($this->url(), $data); ; |
|
107 | 107 | } catch (Exception $e) { |
108 | 108 | Log::error('Creating Client: ' . $e, array('context' => $data)); |
109 | 109 | } |
@@ -6,75 +6,75 @@ |
||
6 | 6 | |
7 | 7 | class ExportHandler extends APIHandler { |
8 | 8 | |
9 | - /** |
|
10 | - * Learning Locker Conection Details |
|
11 | - * |
|
12 | - * @param string|null $id |
|
13 | - * @param string|null $key |
|
14 | - * @param string|null $secret |
|
15 | - * @param string|null $url |
|
16 | - * |
|
17 | - * @return void |
|
18 | - */ |
|
19 | - public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | - { |
|
9 | + /** |
|
10 | + * Learning Locker Conection Details |
|
11 | + * |
|
12 | + * @param string|null $id |
|
13 | + * @param string|null $key |
|
14 | + * @param string|null $secret |
|
15 | + * @param string|null $url |
|
16 | + * |
|
17 | + * @return void |
|
18 | + */ |
|
19 | + public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | + { |
|
21 | 21 | $this->id = $id ? (string) $id : null; |
22 | 22 | $this->key = $key ? (string) $key : null; |
23 | 23 | $this->secret = $secret ? (string) $secret : null; |
24 | 24 | $this->url = $url ? (string) $url : null; |
25 | 25 | |
26 | 26 | parent::__construct($this->key, $this->secret, $this->url); |
27 | - } |
|
27 | + } |
|
28 | 28 | |
29 | 29 | |
30 | - private $export = '/export'; |
|
31 | - private $api = '/api'; |
|
32 | - private $v2 = '/v2'; |
|
30 | + private $export = '/export'; |
|
31 | + private $api = '/api'; |
|
32 | + private $v2 = '/v2'; |
|
33 | 33 | |
34 | - protected $headers = [ |
|
34 | + protected $headers = [ |
|
35 | 35 | 'content-type' => 'application/json' |
36 | - ]; |
|
36 | + ]; |
|
37 | 37 | |
38 | - /** |
|
39 | - * Construct the Learning Locker URL |
|
40 | - * |
|
41 | - * @param string|null $id |
|
42 | - * @return string |
|
43 | - */ |
|
44 | - public function url(string $id = null) { |
|
38 | + /** |
|
39 | + * Construct the Learning Locker URL |
|
40 | + * |
|
41 | + * @param string|null $id |
|
42 | + * @return string |
|
43 | + */ |
|
44 | + public function url(string $id = null) { |
|
45 | 45 | return implode('/', [trim($this->url . $this->api . $this->v2 . $this->export, '/'), $id ?? $id]); |
46 | - } |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * Learning Locker: Get Export |
|
50 | - * |
|
51 | - * @param array $selected |
|
52 | - * @return object $response |
|
53 | - */ |
|
54 | - public function get(array $selected = []) { |
|
48 | + /** |
|
49 | + * Learning Locker: Get Export |
|
50 | + * |
|
51 | + * @param array $selected |
|
52 | + * @return object $response |
|
53 | + */ |
|
54 | + public function get(array $selected = []) { |
|
55 | 55 | try { |
56 | - $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
|
56 | + $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
|
57 | 57 | |
58 | - if ($selected) $response = $this->select($selected, $response); |
|
58 | + if ($selected) $response = $this->select($selected, $response); |
|
59 | 59 | |
60 | - return $response; |
|
60 | + return $response; |
|
61 | 61 | } catch (Exception $e) { |
62 | - return $e; |
|
62 | + return $e; |
|
63 | + } |
|
63 | 64 | } |
64 | - } |
|
65 | 65 | |
66 | - /** |
|
67 | - * Learning Locker: Update Export |
|
68 | - * |
|
69 | - * @return $response |
|
70 | - */ |
|
71 | - public function update($data) { |
|
66 | + /** |
|
67 | + * Learning Locker: Update Export |
|
68 | + * |
|
69 | + * @return $response |
|
70 | + */ |
|
71 | + public function update($data) { |
|
72 | 72 | try { |
73 | - $response = $this->patchToLearningLocker($this->url($this->id ?? $this->id), $data); |
|
74 | - return $response; |
|
73 | + $response = $this->patchToLearningLocker($this->url($this->id ?? $this->id), $data); |
|
74 | + return $response; |
|
75 | 75 | } catch (Exception $e) { |
76 | - return $e; |
|
76 | + return $e; |
|
77 | + } |
|
77 | 78 | } |
78 | - } |
|
79 | 79 | |
80 | 80 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * @return string |
43 | 43 | */ |
44 | 44 | public function url(string $id = null) { |
45 | - return implode('/', [trim($this->url . $this->api . $this->v2 . $this->export, '/'), $id ?? $id]); |
|
45 | + return implode('/', [ trim($this->url . $this->api . $this->v2 . $this->export, '/'), $id ?? $id ]); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * @param array $selected |
52 | 52 | * @return object $response |
53 | 53 | */ |
54 | - public function get(array $selected = []) { |
|
54 | + public function get(array $selected = [ ]) { |
|
55 | 55 | try { |
56 | 56 | $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
57 | 57 |
@@ -55,7 +55,9 @@ |
||
55 | 55 | try { |
56 | 56 | $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
57 | 57 | |
58 | - if ($selected) $response = $this->select($selected, $response); |
|
58 | + if ($selected) { |
|
59 | + $response = $this->select($selected, $response); |
|
60 | + } |
|
59 | 61 | |
60 | 62 | return $response; |
61 | 63 | } catch (Exception $e) { |