-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding kode kegiatan, updating kegiatan
- Loading branch information
Showing
172 changed files
with
569,778 additions
and
4,237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/node_modules | ||
/public/hot | ||
/public/js/components | ||
/public/storage | ||
/storage/*.key | ||
/vendor | ||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use App\KodeKegiatan; | ||
use Illuminate\Http\Request; | ||
|
||
class KodeKegiatanController extends Controller | ||
{ | ||
protected $message = "Kode Kegiatan"; | ||
public function index() | ||
{ | ||
$table_data = KodeKegiatan::advancedFilter(); | ||
|
||
return response() | ||
->json([ | ||
'model' => $table_data | ||
]); | ||
} | ||
|
||
public function create() | ||
{ | ||
return response() | ||
->json([ | ||
'form' => KodeKegiatan::initialize(), | ||
'rules' => KodeKegiatan::$rules, | ||
'option' => [] | ||
]); | ||
} | ||
|
||
public function store(Request $request) | ||
{ | ||
$data = [ | ||
'kode' => $request->kode, | ||
'nama' => $request->nama | ||
]; | ||
// $this->validate($data, KodeKegiatan::$rules); | ||
|
||
$nama = $request->nama; | ||
|
||
$kelas = KodeKegiatan::create($data); | ||
|
||
return response() | ||
->json([ | ||
'saved' => true, | ||
'message' => $this->message . ' ' . $nama . ' berhasil ditambah', | ||
'id' => $kelas->id | ||
]); | ||
} | ||
|
||
public function edit($id) | ||
{ | ||
$kelas = KodeKegiatan::findOrFail($id); | ||
|
||
return response() | ||
->json([ | ||
'form' => $kelas, | ||
'option' => [] | ||
]); | ||
} | ||
|
||
public function update(Request $request, $id) | ||
{ | ||
$data = [ | ||
'kode' => $request->kode, | ||
'nama' => $request->nama | ||
]; | ||
|
||
$nama = $request->nama; | ||
$kelas = KodeKegiatan::findOrFail($id); | ||
|
||
|
||
$kelas->update($data); | ||
return response() | ||
->json([ | ||
'saved' => true, | ||
'message' => $this->message . ' ' . $nama . ' berhasil diubah' | ||
]); | ||
} | ||
|
||
public function destroy($id) | ||
{ | ||
$kelas = KodeKegiatan::findOrFail($id); | ||
$nama = $kelas->nama; | ||
$kelas->delete(); | ||
|
||
return response() | ||
->json([ | ||
'deleted' => true, | ||
'message' => $this->message . ' ' . $nama . ' berhasil dihapus' | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
namespace App; | ||
|
||
use illuminate\Database\Eloquent\Model; | ||
use Spatie\Activitylog\Traits\LogsActivity; | ||
use Illuminate\Database\Eloquent\SoftDeletes; | ||
|
||
class KegiatanMateriNilai extends Model { | ||
|
||
use LogsActivity, SoftDeletes; | ||
|
||
protected $table = 'kegiatan_materi_nilai'; | ||
protected $dates = ['deleted_at']; | ||
protected static $logFillable = true; | ||
protected static $logOnlyDirty = true; | ||
|
||
public static $rules = [ | ||
'name' => 'required' | ||
]; | ||
|
||
protected $fillable = ['aktivis_id','kegiatan_id','materi_id','nilai']; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
use App\Support\Dataviewer; | ||
use Spatie\Activitylog\Traits\LogsActivity; | ||
|
||
class KodeKegiatan extends Model | ||
{ | ||
use Dataviewer, LogsActivity; | ||
protected $table = 'kegiatan_kode'; | ||
protected static $logFillable = true; | ||
|
||
protected $fillable = [ | ||
'kode', 'name', 'created_at', 'updated_at' | ||
]; | ||
|
||
protected $allowedFilters = [ | ||
'id', 'kode', 'name' | ||
]; | ||
|
||
protected $orderable = [ | ||
'id', 'kode', 'name' | ||
]; | ||
|
||
public static function initialize() | ||
{ | ||
return [ | ||
'kode' => '', 'name' => '' | ||
]; | ||
} | ||
|
||
public static $rules = [ | ||
'kode' => 'required', | ||
'name' => 'required' | ||
]; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.