Skip to content

Commit

Permalink
Merge branch 'development' into api-permision
Browse files Browse the repository at this point in the history
  • Loading branch information
vickyrolanda committed Jul 5, 2023
2 parents fd07b8c + b8bed8b commit ee9f966
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 39 deletions.
2 changes: 1 addition & 1 deletion app/Helpers/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
function openkab_versi()
{
return 'v2306.0.0';
return 'v2307.0.0';
}
}

Expand Down
7 changes: 6 additions & 1 deletion app/Http/Controllers/DasborController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

namespace App\Http\Controllers;

use App\Models\Identitas;

class DasborController extends Controller
{
public function index()
{
return view('dasbor.index');
$identitas = new Identitas();
$data = $identitas->pengaturan();

return view('dasbor.index', compact('data'));
}
}
20 changes: 20 additions & 0 deletions app/Models/Identitas.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,24 @@
class Identitas extends Model
{
use HasFactory;

protected $table = "identitas";

protected $fillable = [
"nama_aplikasi", "deskripsi", "favicon",
"logo", "nama_kabupaten", "kode_kabupaten",
"nama_provinsi", "kode_provinsi", "sebutan_kab"
];

public static function pengaturan()
{
$identitas = self::first();

$data['nama_aplikasi'] = $identitas->nama_aplikasi ?? config('app.namaAplikasi');
$data['sebutanKab'] = $identitas->sebutan_kab ?? config('app.sebutanKab');
$nama_kabupaten = preg_replace("/KAB/", "", $identitas->nama_kabupaten) ?? config('app.namaKab');
$data['nama_kabupaten'] = strtolower($data['sebutanKab']) == 'kota' ? $nama_kabupaten : $data['sebutanKab'] . ' ' . $nama_kabupaten;

return $data;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
Expand All @@ -26,6 +27,11 @@ public function up()
$table->string('sebutan_kab', 100);
$table->timestamps();
});

Artisan::call('db:seed', [
'--class' => 'IdentitasSeeder',
'--force' => true,
]);
}

/**
Expand Down
30 changes: 0 additions & 30 deletions database/migrations/2023_05_04_180525_seed_identitas.php

This file was deleted.

5 changes: 1 addition & 4 deletions database/seeders/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ class DatabaseSeeder extends Seeder
*/
public function run()
{
$this->call([
CreateAdminUserSeeder::class,
IdentitasSeeder::class,
]);
//
}
}
10 changes: 10 additions & 0 deletions public/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

<FilesMatch "\.(php|php\.|php3?|phtml|phpjpeg|pl|py|jsp|asp|htm|shtml|sh|cgi)$">
order allow,deny
deny from all
</FilesMatch>

<Files index.php>
Order Allow,Deny
Allow from all
</Files>
6 changes: 3 additions & 3 deletions resources/views/dasbor/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@section('content')
<x-adminlte-callout theme="warning">
Selamat datang <b>{{ Auth::user()->username ?? '' }}</b> di Dasbor Utama
<b>{{ config('app.namaAplikasi') . ' ' . config('app.sebutanKab') . ' ' . config('app.namaKab') }}</b>.
<b>{{ ucwords(strtolower($data['nama_aplikasi'])) . ' ' . ucwords(strtolower($data['nama_kabupaten'])) }}</b>.
</x-adminlte-callout>

<div class="row">
Expand All @@ -21,12 +21,12 @@
icon-theme="blue" />
</a>

<a href="{{ url('keluarga') }}" class="unlink col-12 col-sm-6 col-md-3">
<a href="#" class="unlink col-12 col-sm-6 col-md-3">
<x-adminlte-info-box id="keluarga" title="Keluarga" text="2991" icon="fas fa-lg fa-users"
icon-theme="red" />
</a>

<a href="{{ url('rtm') }}" class="unlink col-12 col-sm-6 col-md-3">
<a href="#" class="unlink col-12 col-sm-6 col-md-3">
<x-adminlte-info-box id="rtm" title="RTM" text="221" icon="fas fa-lg fa-home" icon-theme="green" />
</a>

Expand Down

0 comments on commit ee9f966

Please sign in to comment.