Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sipeka
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Siti Aisah
sipeka
Commits
625a5b77
Commit
625a5b77
authored
May 30, 2024
by
Triyah Fatmawati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update route api saku
parent
0c1fc5ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
18 deletions
+23
-18
app/Http/Controllers/Api/ApiSakuController.php
+22
-17
routes/api.php
+1
-1
No files found.
app/Http/Controllers/Api/ApiSakuController.php
View file @
625a5b77
...
@@ -10,27 +10,32 @@
...
@@ -10,27 +10,32 @@
class
ApiSakuController
extends
Controller
class
ApiSakuController
extends
Controller
{
{
public
function
index
(){
public
function
index
(
$tahun
){
$dataTelaah
=
[];
$penelaah
=
Penelaah
::
query
()
$penelaah
=
Penelaah
::
query
()
->
with
(
'penelaah'
)
->
whereHas
(
'penelaah'
,
function
(
$query
)
use
(
$tahun
)
{
// ->where('created_at', '<', '2024-05-20')
$query
->
where
(
'tahun'
,
$tahun
);
})
->
orderBy
(
'nip'
)
->
orderBy
(
'nip'
)
->
get
();
->
get
();
foreach
(
$penelaah
as
$key
=>
$pen
)
{
if
(
$penelaah
){
$dataTelaah
[]
=
[
foreach
(
$penelaah
as
$key
=>
$pen
)
{
'id'
=>
$pen
->
id
,
$dataTelaah
[]
=
[
'nama'
=>
$pen
->
nama
,
'id'
=>
$pen
->
id
,
'nip'
=>
$pen
->
nip
,
'nama'
=>
$pen
->
nama
,
'nik'
=>
$pen
->
nik
,
'nip'
=>
$pen
->
nip
,
'unit'
=>
$pen
->
unit
,
'nik'
=>
$pen
->
nik
,
'created_at'
=>
$pen
->
created_at
,
'unit'
=>
$pen
->
unit
,
'judul'
=>
$pen
->
penelaah
->
judul
,
'created_at'
=>
$pen
->
created_at
,
'kode_kategori'
=>
$pen
->
penelaah
->
kategori
->
kode_kategori
,
'judul'
=>
$pen
->
penelaah
->
judul
,
'nama_kategori'
=>
$pen
->
penelaah
->
kategori
->
nama_kategori
,
'kode_kategori'
=>
$pen
->
penelaah
->
kategori
->
kode_kategori
,
'poin_saku'
=>
$pen
->
penelaah
->
kategori
->
poin_saku
,
'nama_kategori'
=>
$pen
->
penelaah
->
kategori
->
nama_kategori
,
'tahun'
=>
$pen
->
penelaah
->
tahun
'poin_saku'
=>
$pen
->
penelaah
->
kategori
->
poin_saku
,
];
'tahun'
=>
$pen
->
penelaah
->
tahun
];
}
}
}
return
response
()
->
json
(
$dataTelaah
);
return
response
()
->
json
(
$dataTelaah
);
...
...
routes/api.php
View file @
625a5b77
...
@@ -19,5 +19,5 @@
...
@@ -19,5 +19,5 @@
return
$request
->
user
();
return
$request
->
user
();
});
});
Route
::
get
(
'/saku'
,
[
ApiSakuController
::
class
,
'index'
]);
Route
::
get
(
'/saku
/{tahun}
'
,
[
ApiSakuController
::
class
,
'index'
]);
Route
::
get
(
'/saku1'
,
[
ApiSakuController
::
class
,
'saku1'
]);
Route
::
get
(
'/saku1'
,
[
ApiSakuController
::
class
,
'saku1'
]);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment