@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -Route::group(['middleware' => 'web', 'as' => 'laralang::', 'prefix' => config('laralang.default.prefix'), 'namespace' => 'Aitor24\Laralang\Controllers'], function() { |
|
| 2 | +Route::group([ 'middleware' => 'web', 'as' => 'laralang::', 'prefix' => config('laralang.default.prefix'), 'namespace' => 'Aitor24\Laralang\Controllers' ], function() { |
|
| 3 | 3 | |
| 4 | 4 | Route::get('/translations', 'LaralangController@retView')->name('translations'); |
| 5 | 5 | Route::get('/test', 'LaralangController@testfunction'); |
@@ -8,6 +8,6 @@ discard block |
||
| 8 | 8 | Route::get('/edit/{id}/{translation}', 'LaralangController@editTrans'); |
| 9 | 9 | }); |
| 10 | 10 | |
| 11 | -Route::group(['middleware' => ['bindings', 'throttle:1000,1'], 'as' => 'laralang::', 'prefix' => config('laralang.default.prefix'), 'namespace' => 'Aitor24\Laralang\Controllers'], function() { |
|
| 11 | +Route::group([ 'middleware' => [ 'bindings', 'throttle:1000,1' ], 'as' => 'laralang::', 'prefix' => config('laralang.default.prefix'), 'namespace' => 'Aitor24\Laralang\Controllers' ], function() { |
|
| 12 | 12 | Route::get('/api', 'LaralangController@api')->name('api'); |
| 13 | 13 | }); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function boot() |
| 15 | 15 | { |
| 16 | - if (! $this->app->routesAreCached()) { |
|
| 16 | + if (!$this->app->routesAreCached()) { |
|
| 17 | 17 | require __DIR__.'/Routes/web.php'; |
| 18 | 18 | } |
| 19 | 19 | |
@@ -21,11 +21,11 @@ |
||
| 21 | 21 | |
| 22 | 22 | public function testfunction(Request $request) |
| 23 | 23 | { |
| 24 | - if ($request->isMethod('post')){ |
|
| 25 | - return response()->json(['response' => 'This is post method']); |
|
| 24 | + if ($request->isMethod('post')) { |
|
| 25 | + return response()->json([ 'response' => 'This is post method' ]); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - return response()->json(['response' => 'This is get method']); |
|
| 28 | + return response()->json([ 'response' => 'This is get method' ]); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | public function deleteTrans($id) { |
@@ -156,13 +156,13 @@ |
||
| 156 | 156 | $( function() { |
| 157 | 157 | $('#delete').click(function() { |
| 158 | 158 | <?php $url_route = url('/').'/'.config('laralang.default.prefix').'/delete'; |
| 159 | - ?> |
|
| 159 | + ?> |
|
| 160 | 160 | $.get("{{ $url_route }}"+'/'+$('.trans-id').val()); |
| 161 | 161 | }); |
| 162 | 162 | $('#edit').click(function() { |
| 163 | 163 | var translation = $('.input-trans').val(); |
| 164 | 164 | <?php $url_route = url('/').'/'.config('laralang.default.prefix').'/edit'; |
| 165 | - ?> |
|
| 165 | + ?> |
|
| 166 | 166 | $.get("{{ $url_route }}"+'/'+$('.trans-id').val()+'/'+translation); |
| 167 | 167 | }); |
| 168 | 168 | |