Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
khoirul mustofa committed Oct 4, 2022
0 parents commit f6568e6
Show file tree
Hide file tree
Showing 263 changed files with 44,796 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2

[docker-compose.yml]
indent_size = 4
52 changes: 52 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
* text=auto

*.blade.php diff=html
*.css diff=css
*.html diff=html
*.md diff=markdown
*.php diff=php

/.github export-ignore
CHANGELOG.md export-ignore
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.phpunit.result.cache
docker-compose.override.yml
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
pprs.zip
/.idea
/.vscode
13 changes: 13 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
php:
preset: laravel
version: 8
disabled:
- no_unused_imports
finder:
not-name:
- index.php
js:
finder:
not-name:
- webpack.mix.js
css: true
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
![header](https://capsule-render.vercel.app/api?type=waving&color=auto&height=300&section=header&text=PPRS%20Pusat&fontSize=90&animation=fadeIn&fontAlignY=38&desc=)
2022
32 changes: 32 additions & 0 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')->hourly();
}

/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');

require base_path('routes/console.php');
}
}
41 changes: 41 additions & 0 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace App\Exceptions;

use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;

class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array<int, class-string<Throwable>>
*/
protected $dontReport = [
//
];

/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array<int, string>
*/
protected $dontFlash = [
'current_password',
'password',
'password_confirmation',
];

/**
* Register the exception handling callbacks for the application.
*
* @return void
*/
public function register()
{
$this->reportable(function (Throwable $e) {
//
});
}
}
106 changes: 106 additions & 0 deletions app/Http/Controllers/BannerController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<?php

namespace App\Http\Controllers;

use App\Models\Banner;
use Illuminate\Support\Facades\Storage;
use App\Http\Requests\StoreBannerRequest;
use App\Http\Requests\UpdateBannerRequest;

class BannerController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return view('dashboard.banner.index',[
'data' => Banner::all()
]);
}

/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}

/**
* Store a newly created resource in storage.
*
* @param \App\Http\Requests\StoreBannerRequest $request
* @return \Illuminate\Http\Response
*/
public function store(StoreBannerRequest $request)
{
//
}

/**
* Display the specified resource.
*
* @param \App\Models\Banner $banner
* @return \Illuminate\Http\Response
*/
public function show(Banner $banner)
{
//
}

/**
* Show the form for editing the specified resource.
*
* @param \App\Models\Banner $banner
* @return \Illuminate\Http\Response
*/
public function edit(Banner $banner)
{
return view('dashboard.banner.edit',[
'data' => Banner::find($banner->id)
]);
}

/**
* Update the specified resource in storage.
*
* @param \App\Http\Requests\UpdateBannerRequest $request
* @param \App\Models\Banner $banner
* @return \Illuminate\Http\Response
*/
public function update(UpdateBannerRequest $request, Banner $banner)
{
$validateData = $request->validate([
'image' => 'image|file'
]);

// Jika ada gambar baru
if ($request->file('image')) {
// jika gambar lamanya ada, maka hapus gambar
if ($request->oldImage) {
Storage::delete($request->oldImage);
}
// jika tidak ada gambar lama, lakukan penyimpanan kestorage folder "berita-image"
$validateData['image'] = $request->file('image')->store('banner');
}
Banner::where('id', $banner->id)
->update($validateData);
return redirect('/dashboard/banner')->with('success', 'Banner berhasil diupdate!');
}

/**
* Remove the specified resource from storage.
*
* @param \App\Models\Banner $banner
* @return \Illuminate\Http\Response
*/
public function destroy(Banner $banner)
{
//
}
}
40 changes: 40 additions & 0 deletions app/Http/Controllers/BerandaController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

namespace App\Http\Controllers;

use App\Models\Banner;
use App\Models\Berita;
use App\Models\Pengurus;
use App\Models\Sambutan;
use Illuminate\Http\Request;

class BerandaController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
if (Berita::all()->count() > 3) {
$response = view('beranda', [
"title" => "beranda",
"headLine" => Berita::latest()->take(3)->get(),
"pengurus" => Pengurus::first()->take(3)->get(),
"sambutan" => Sambutan::all(),
"banner" => Banner::all()
]);
} else {
$response = view('beranda', [
"title" => "beranda",
"headLine" => Berita::all(),
"pengurus" => Pengurus::all(),
"sambutan" => Sambutan::all(),
"banner" => Banner::all()
]);
}

return $response;
}
}
Loading

0 comments on commit f6568e6

Please sign in to comment.