From 355aef466457a348a526e1876b3f293bb70d3e5d Mon Sep 17 00:00:00 2001 From: Christian Braybrooke Date: Thu, 20 Aug 2020 14:14:37 +0100 Subject: [PATCH] Add small improvements --- .phpintel/417e2388a62d948b4249cf7249d84be6 | Bin 0 -> 654 bytes .phpintel/7de6a3eec856e0d05769a158727d5a0c | Bin 0 -> 6 bytes .phpintel/8fe0d7befeb3000f189fc2a16a3b3c28 | Bin 0 -> 6 bytes .phpintel/index | Bin 0 -> 201 bytes config/snscommunicationrecords.php | 4 +++- routes/api.php | 2 +- .../Api/SNSCommunicationRecordsController.php | 1 + 7 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .phpintel/417e2388a62d948b4249cf7249d84be6 create mode 100644 .phpintel/7de6a3eec856e0d05769a158727d5a0c create mode 100644 .phpintel/8fe0d7befeb3000f189fc2a16a3b3c28 create mode 100644 .phpintel/index diff --git a/.phpintel/417e2388a62d948b4249cf7249d84be6 b/.phpintel/417e2388a62d948b4249cf7249d84be6 new file mode 100644 index 0000000000000000000000000000000000000000..dda4bbc65a1a579280a050cf4058cf211e44e7f1 GIT binary patch literal 654 zcmah_%W7LO5WR_?ahfJ+(&y?Hx-bSu{e+fmS}3JB6tu80vOLKM>q>VdUDGTA{e$lN zwH?b&(?X$wff>y?hjZq8YevQJj`oJKR}=+&OW>A~_T_-5OYc(f)s<``QSm z{>9u8A7B?X)^w0l#Khv726B%rzNN!_iU6qzF4801rdS!bq@x_@x^bEw%NC=TUemGs zxrsI!4a&_Mm6J>@RcSe8>90%uXNEFtGwjg!q<1xkuF7)y(b}dmP9>Obl1(Q-4Y1Ce zux)-5whsSAh_!bSc0fTV*|k#@(5dXR*ZJJIH6NXx$PSO%su<}^zUKbFccb&Hrov66 zr!#ssqvyjcdhd^3U=LJtM=yuCk1cFt2fNtAJ|5rz50MXwM_k8Tr(9=vjx6-5fs0=z Cu*9VR literal 0 HcmV?d00001 diff --git a/.phpintel/7de6a3eec856e0d05769a158727d5a0c b/.phpintel/7de6a3eec856e0d05769a158727d5a0c new file mode 100644 index 0000000000000000000000000000000000000000..482c0e338367d0aeb4ddc43602ac727276f77052 GIT binary patch literal 6 NcmZo*jxA)+0{{jJ0e}Di literal 0 HcmV?d00001 diff --git a/.phpintel/8fe0d7befeb3000f189fc2a16a3b3c28 b/.phpintel/8fe0d7befeb3000f189fc2a16a3b3c28 new file mode 100644 index 0000000000000000000000000000000000000000..482c0e338367d0aeb4ddc43602ac727276f77052 GIT binary patch literal 6 NcmZo*jxA)+0{{jJ0e}Di literal 0 HcmV?d00001 diff --git a/.phpintel/index b/.phpintel/index new file mode 100644 index 0000000000000000000000000000000000000000..7443cb8d9b255ae1a3f301a13ba5a8e2c2a3edde GIT binary patch literal 201 zcmajZK?=e!5QX7rPvQa6IfHcLLPRV=HzLzG*w8eS%tXP3;0?U8E(CGq{_(y4QQfoY z7RH!%(>6R!m*^c9&v8eN<)jVAA{+uqo*nYMd%mZzR}uv`h}YsV_JX%wm`8%Z4#QD> qA%!&xUMbkOY=3C`vF#S!h-U&72dh#NeBTt7$;02MIt?jTsPzj-bxE86 literal 0 HcmV?d00001 diff --git a/config/snscommunicationrecords.php b/config/snscommunicationrecords.php index 52c5cc3..6757c53 100644 --- a/config/snscommunicationrecords.php +++ b/config/snscommunicationrecords.php @@ -3,5 +3,7 @@ return [ 'record_class' => PurpleMountain\SNSCommunicationRecords\Models\SNSCommunicationRecord::class, - 'to_class' => App\User::class + 'to_class' => App\User::class, + + 'api_middleware' => ['auth:api'] ]; \ No newline at end of file diff --git a/routes/api.php b/routes/api.php index 125ff8b..28a69bf 100644 --- a/routes/api.php +++ b/routes/api.php @@ -10,4 +10,4 @@ | contains the "api" middleware group. | */ -Route::middleware('auth:api')->get('communication-records', 'SNSCommunicationRecordsController'); \ No newline at end of file +Route::middleware(config('snscommunicationrecords.api_middleware'))->get('communication-records', 'SNSCommunicationRecordsController'); \ No newline at end of file diff --git a/src/Http/Controllers/Api/SNSCommunicationRecordsController.php b/src/Http/Controllers/Api/SNSCommunicationRecordsController.php index 80d5c6d..4cfd811 100644 --- a/src/Http/Controllers/Api/SNSCommunicationRecordsController.php +++ b/src/Http/Controllers/Api/SNSCommunicationRecordsController.php @@ -22,6 +22,7 @@ public function __invoke(Request $request) return SNSCommunicationRecordResource::collection( config('snscommunicationrecords.record_class')::with($request->with ?: []) + ->orderByDesc('created_at') ->paginate() ); }