@@ -15,7 +15,7 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | public function testStore() |
| 17 | 17 | { |
| 18 | - $response = $this-action('POST', 'Crystoline\LaraRestApiTestController@yourAction', ['links' => 'link1 \n link2']); |
|
| 18 | + $response = $this - action('POST', 'Crystoline\LaraRestApiTestController@yourAction', ['links' => 'link1 \n link2']); |
|
| 19 | 19 | // you can check if response was ok |
| 20 | 20 | $this->assertTrue($response->isOk(), "Custom message if something went wrong"); |
| 21 | 21 | // or if view received variable |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | use Illuminate\Http\Request; |
| 6 | 6 | interface IRestApiAble |
| 7 | 7 | {
|
| 8 | - public static function getModel() : string ; |
|
| 8 | + public static function getModel() : string; |
|
| 9 | 9 | |
| 10 | 10 | public function index(Request $request); |
| 11 | 11 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * @param $searchables |
| 33 | 33 | * return none, Builder passed by reference |
| 34 | 34 | */ |
| 35 | - public static function doSearch(Request $request, Builder $builder, $searchables) ; |
|
| 35 | + public static function doSearch(Request $request, Builder $builder, $searchables); |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * Order Data |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * @param Builder $builder |
| 41 | 41 | * @param array $orderBy |
| 42 | 42 | */ |
| 43 | - public static function doOrderBy(Request $request, Builder $builder,array $orderBy); |
|
| 43 | + public static function doOrderBy(Request $request, Builder $builder, array $orderBy); |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Perform action before data list |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | * @param Request $request |
| 18 | 18 | * @return string |
| 19 | 19 | */ |
| 20 | - public static function fileBasePath(Request $request){
|
|
| 20 | + public static function fileBasePath(Request $request) {
|
|
| 21 | 21 | return ''; |
| 22 | 22 | } |
| 23 | 23 | } |
| 24 | 24 | \ No newline at end of file |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | public static function doSearch(Request $request, Builder $builder, $searchables) /*:Builder*/ |
| 177 | 177 | {
|
| 178 | - $builder->where(function (Builder $builder) use ($request, $searchables) {
|
|
| 178 | + $builder->where(function(Builder $builder) use ($request, $searchables) {
|
|
| 179 | 179 | if ($search = $request->input('search')) {
|
| 180 | 180 | $keywords = explode(' ', trim($search));
|
| 181 | 181 | if ($searchables) {
|
@@ -370,9 +370,9 @@ discard block |
||
| 370 | 370 | $interfaces = class_implements(self::class); |
| 371 | 371 | $base = isset($interfaces[IFileUpload::class]) ? self::fileBasePath($request) : ''; |
| 372 | 372 | if ($base) {
|
| 373 | - $base = trim($base, '/,\\') . '/'; |
|
| 373 | + $base = trim($base, '/,\\').'/'; |
|
| 374 | 374 | } |
| 375 | - $path = $request->$key->store('public/' . $base . $key);
|
|
| 375 | + $path = $request->$key->store('public/'.$base.$key);
|
|
| 376 | 376 | $path = str_replace('public/', 'storage/', $path);
|
| 377 | 377 | |
| 378 | 378 | $path_url = asset($path); |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | $fields = self::getUniqueFields(); |
| 470 | 470 | foreach ($fields as $field) {
|
| 471 | 471 | if (isset($rules[$field])) {
|
| 472 | - $rules[$field] .= ',' . $id; |
|
| 472 | + $rules[$field] .= ','.$id; |
|
| 473 | 473 | } |
| 474 | 474 | } |
| 475 | 475 | return $rules; |
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | */ |
| 558 | 558 | protected function respond($status, $data = []): JsonResponse |
| 559 | 559 | {
|
| 560 | - $status = array_key_exists($status, $this->statusCodes)? $this->statusCodes[$status]: $status; |
|
| 560 | + $status = array_key_exists($status, $this->statusCodes) ? $this->statusCodes[$status] : $status; |
|
| 561 | 561 | return response()->json($data, $status); |
| 562 | 562 | } |
| 563 | 563 | |