initial commit
This commit is contained in:
commit
28301e4312
219 changed files with 23035 additions and 0 deletions
41
app/Http/Controllers/Auth/AuthController.php
Executable file
41
app/Http/Controllers/Auth/AuthController.php
Executable file
|
@ -0,0 +1,41 @@
|
|||
<?php namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Contracts\Auth\Registrar;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
|
||||
|
||||
class AuthController extends Controller {
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Registration & Login Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles the registration of new users, as well as the
|
||||
| authentication of existing users. By default, this controller uses
|
||||
| a simple trait to add these behaviors. Why don't you explore it?
|
||||
|
|
||||
*/
|
||||
|
||||
use AuthenticatesAndRegistersUsers;
|
||||
|
||||
//kalo sudah login redirect kemana
|
||||
protected $redirectTo = '/';
|
||||
|
||||
/**
|
||||
* Create a new authentication controller instance.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Auth\Guard $auth
|
||||
* @param \Illuminate\Contracts\Auth\Registrar $registrar
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth, Registrar $registrar)
|
||||
{
|
||||
$this->auth = $auth;
|
||||
$this->registrar = $registrar;
|
||||
|
||||
$this->middleware('guest', ['except' => 'getLogout']);
|
||||
}
|
||||
|
||||
}
|
38
app/Http/Controllers/Auth/PasswordController.php
Executable file
38
app/Http/Controllers/Auth/PasswordController.php
Executable file
|
@ -0,0 +1,38 @@
|
|||
<?php namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Contracts\Auth\PasswordBroker;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
|
||||
class PasswordController extends Controller {
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset requests
|
||||
| and uses a simple trait to include this behavior. You're free to
|
||||
| explore this trait and override any methods you wish to tweak.
|
||||
|
|
||||
*/
|
||||
|
||||
use ResetsPasswords;
|
||||
|
||||
/**
|
||||
* Create a new password controller instance.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Auth\Guard $auth
|
||||
* @param \Illuminate\Contracts\Auth\PasswordBroker $passwords
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth, PasswordBroker $passwords)
|
||||
{
|
||||
$this->auth = $auth;
|
||||
$this->passwords = $passwords;
|
||||
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
}
|
96
app/Http/Controllers/BookController.php
Executable file
96
app/Http/Controllers/BookController.php
Executable file
|
@ -0,0 +1,96 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Book;
|
||||
use App\Category;
|
||||
use App\Shelf;
|
||||
use App\Http\Requests\BookRequest;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class BookController extends Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
$this->middleware('auth');
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$books = Book::with('category', 'shelf')->get();
|
||||
|
||||
return view('lms.settings.book.book', compact('books'));
|
||||
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
$categories = Category::lists('category', 'id');
|
||||
$shelves = Shelf::lists('shelf', 'id');
|
||||
|
||||
$tanggal = date('Y-m-d');
|
||||
$ambilTahun = substr($tanggal, 0, 4);
|
||||
for($tahun = 1990; $tahun <= $ambilTahun; $tahun++){
|
||||
$years[] = $tahun;
|
||||
}
|
||||
|
||||
return view('lms.settings.book.add', compact('categories', 'shelves', 'years'));
|
||||
}
|
||||
|
||||
public function store(BookRequest $request)
|
||||
{
|
||||
|
||||
$input = $request->all();
|
||||
|
||||
$book = Book::create($input);
|
||||
|
||||
session()->flash('flash_message', 'You have been addded 1 book!');
|
||||
|
||||
return redirect()->route('settings.book');
|
||||
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
|
||||
$book = Book::findOrFail($id);
|
||||
$categories = Category::lists('category', 'id');
|
||||
$shelves = Shelf::lists('shelf', 'id');
|
||||
|
||||
return view('lms.settings.book.edit', compact('book', 'categories', 'shelves'));
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function update($id, BookRequest $request)
|
||||
{
|
||||
|
||||
$book = Book::findOrFail($id);
|
||||
|
||||
$input = $request->all();
|
||||
|
||||
$book->update($input);
|
||||
|
||||
session()->flash('flash_message', 'You have been updated 1 book!');
|
||||
|
||||
return redirect()->route('settings.book');
|
||||
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
|
||||
$book = Book::findOrFail($id);
|
||||
|
||||
$book->delete();
|
||||
|
||||
session()->flash('flash_message', 'You have been deleted 1 book!');
|
||||
|
||||
return redirect()->route('settings.book');
|
||||
|
||||
}
|
||||
|
||||
}
|
85
app/Http/Controllers/CategoryController.php
Executable file
85
app/Http/Controllers/CategoryController.php
Executable file
|
@ -0,0 +1,85 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Category;
|
||||
use App\Http\Requests\CategoryRequest;
|
||||
|
||||
class CategoryController extends Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
$this->middleware('auth');
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$categories = Category::get();
|
||||
|
||||
return view('lms.settings.category.category', compact('categories'));
|
||||
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
|
||||
return view('lms.settings.category.add');
|
||||
|
||||
}
|
||||
|
||||
public function store(CategoryRequest $request)
|
||||
{
|
||||
|
||||
$input = $request->all();
|
||||
|
||||
$category = Category::create($input);
|
||||
|
||||
session()->flash('flash_message', 'You have been addded 1 category!');
|
||||
|
||||
return redirect()->route('settings.category');
|
||||
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
|
||||
$category = Category::findOrFail($id);
|
||||
|
||||
return view('lms.settings.category.edit', compact('category'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function update($id, CategoryRequest $request)
|
||||
{
|
||||
|
||||
$category = Category::findOrFail($id);
|
||||
|
||||
$input = $request->all();
|
||||
|
||||
session()->flash('flash_message', 'You have been updated 1 category!');
|
||||
|
||||
$category->update($input);
|
||||
|
||||
return redirect()->route('settings.category');
|
||||
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
|
||||
$category = Category::findOrFail($id);
|
||||
|
||||
$category->delete();
|
||||
|
||||
session()->flash('flash_message', 'You have been deleted 1 category!');
|
||||
|
||||
return redirect()->route('settings.category');
|
||||
|
||||
}
|
||||
|
||||
}
|
11
app/Http/Controllers/Controller.php
Executable file
11
app/Http/Controllers/Controller.php
Executable file
|
@ -0,0 +1,11 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Foundation\Bus\DispatchesCommands;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
|
||||
abstract class Controller extends BaseController {
|
||||
|
||||
use DispatchesCommands, ValidatesRequests;
|
||||
|
||||
}
|
50
app/Http/Controllers/FinesController.php
Executable file
50
app/Http/Controllers/FinesController.php
Executable file
|
@ -0,0 +1,50 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Fine;
|
||||
use App\Http\Requests\FinesRequest;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class FinesController extends Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
$this->middleware('auth');
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$fines = Fine::get();
|
||||
|
||||
return view('lms.settings.fine.fine', compact('fines'));
|
||||
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
|
||||
$fine = Fine::findOrFail($id);
|
||||
|
||||
return view('lms.settings.fine.edit', compact('fine'));
|
||||
|
||||
}
|
||||
|
||||
public function update($id, FinesRequest $request)
|
||||
{
|
||||
$fines = Fine::findOrFail($id);
|
||||
|
||||
$input = $request->all();
|
||||
|
||||
$fines->update($input);
|
||||
|
||||
session()->flash('flash_message', 'You have been updated fines!');
|
||||
|
||||
return redirect()->route('settings.fines');
|
||||
|
||||
}
|
||||
|
||||
}
|
57
app/Http/Controllers/PagesController.php
Executable file
57
app/Http/Controllers/PagesController.php
Executable file
|
@ -0,0 +1,57 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Book;
|
||||
use App\Category;
|
||||
use App\Shelf;
|
||||
use App\Periode;
|
||||
use App\Student;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PagesController extends Controller {
|
||||
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
$this->middleware('auth');
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$tglSekarang = time();
|
||||
|
||||
$students = Student::get();
|
||||
|
||||
foreach ($students as $student) {
|
||||
|
||||
$dateDiff = $tglSekarang - $student['registered_at'];
|
||||
$durasi = floor($dateDiff/(60 * 60 * 24));
|
||||
$periode = Periode::first();
|
||||
if($durasi > $periode['days']){
|
||||
$student->update(['status' => 0]);
|
||||
}
|
||||
else{
|
||||
$student->update(['status' => 1]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return view('lms.index');
|
||||
|
||||
}
|
||||
|
||||
public function books()
|
||||
{
|
||||
|
||||
$books = Book::with('category', 'shelf')->orderByTitle()->get();
|
||||
|
||||
return view('lms.books', compact('books'));
|
||||
|
||||
}
|
||||
|
||||
}
|
148
app/Http/Controllers/PeminjamanController.php
Executable file
148
app/Http/Controllers/PeminjamanController.php
Executable file
|
@ -0,0 +1,148 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Book;
|
||||
use App\Student;
|
||||
use App\Transaction;
|
||||
use App\Fine;
|
||||
use App\Category;
|
||||
use App\Http\Requests\PeminjamanRequest;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PeminjamanController extends Controller {
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
$this->middleware('auth');
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
//$books = Book::available()->orderByTitle()->lists('title', 'id');
|
||||
$students = Student::notLimit()->active()->orderByName()->lists('name', 'id');
|
||||
//$categories = Category::lists('category', 'id');
|
||||
$categories = Category::get();
|
||||
|
||||
|
||||
return view('lms.peminjaman.peminjaman', compact('students', 'categories'));
|
||||
|
||||
}
|
||||
|
||||
public function store(PeminjamanRequest $request)
|
||||
{
|
||||
|
||||
$input = $request->all();
|
||||
|
||||
$book_id = $input['book_id'];
|
||||
|
||||
$student_id = $input['student_id'];
|
||||
|
||||
$input['borrowed_at'] = time();
|
||||
|
||||
$transaction = Transaction::create($input);
|
||||
|
||||
$book = Book::findOrFail($book_id);
|
||||
|
||||
$stock = $book['stock'] - 1;
|
||||
|
||||
$book->update(['stock' => $stock]);
|
||||
|
||||
$student = Student::findOrFail($student_id);
|
||||
|
||||
$borrow = $student['borrow'] + 1;
|
||||
|
||||
$student->update(['borrow' => $borrow]);
|
||||
|
||||
session()->flash('flash_message', 'You have been added 1 transaction!');
|
||||
|
||||
return redirect()->route('peminjaman.laporan');
|
||||
|
||||
}
|
||||
|
||||
public function laporan()
|
||||
{
|
||||
$tglSekarang = time();
|
||||
|
||||
$transactions = Transaction::with('student', 'book')->notReturnedYet()->get();
|
||||
|
||||
foreach ($transactions as $transaction) {
|
||||
|
||||
$dateDiff = $tglSekarang - $transaction['borrowed_at'];
|
||||
$durasi = floor($dateDiff/(60 * 60 * 24));
|
||||
$fines = Fine::first();
|
||||
if($durasi > $fines['days']){
|
||||
$hariDenda = $durasi - $fines['days'];
|
||||
$denda = $hariDenda * $fines['fines'];
|
||||
$transaction->update(['fines' => $denda]);
|
||||
}
|
||||
else{
|
||||
$denda = 0;
|
||||
$transaction->update(['fines' => $denda]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//ambil tanggal
|
||||
//$date2 = mktime(0,0,0,05,31,2015);
|
||||
//return $date2;
|
||||
return view('lms.peminjaman.laporan', compact('transactions', 'durasi'));
|
||||
}
|
||||
|
||||
public function pengembalian($id)
|
||||
{
|
||||
$returnedAt = time();
|
||||
|
||||
$transaction = Transaction::findOrFail($id);
|
||||
|
||||
$transaction->update(['status' => 1, 'returned_at' => $returnedAt]);
|
||||
|
||||
//ini bisa langsung, cuman kan harus ambil data stock nya dulu mzzz
|
||||
//$transaction->book()->update(['stock' => 7]);
|
||||
|
||||
$book = Book::findOrFail($transaction['book_id']);
|
||||
|
||||
$stock = $book['stock'] + 1;
|
||||
|
||||
$book->update(['stock' => $stock]);
|
||||
|
||||
$student = Student::findOrFail($transaction['student_id']);
|
||||
|
||||
$borrow = $student['borrow'] - 1;
|
||||
|
||||
$student->update(['borrow' => $borrow]);
|
||||
|
||||
session()->flash('flash_message', 'You have been doing 1 returned transaction!');
|
||||
|
||||
return redirect()->route('peminjaman.histori');
|
||||
|
||||
}
|
||||
|
||||
public function perpanjang($id)
|
||||
{
|
||||
|
||||
$transaction = Transaction::findOrFail($id);
|
||||
|
||||
$dateNow = time();
|
||||
|
||||
$transaction->update(['borrowed_at' => $dateNow, 'fines' => 0]);
|
||||
|
||||
session()->flash('flash_message', 'You have been added 1 perpanjang!');
|
||||
|
||||
return redirect()->route('peminjaman.laporan');
|
||||
|
||||
}
|
||||
|
||||
public function histori()
|
||||
{
|
||||
$transactions = Transaction::returned()->get();
|
||||
|
||||
return view('lms.peminjaman.histori', compact('transactions'));
|
||||
}
|
||||
|
||||
|
||||
}
|
71
app/Http/Controllers/PeriodeController.php
Executable file
71
app/Http/Controllers/PeriodeController.php
Executable file
|
@ -0,0 +1,71 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Periode;
|
||||
use App\Student;
|
||||
use App\Http\Requests\PeriodeRequest;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PeriodeController extends Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
$this->middleware('auth');
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$periodes = Periode::get();
|
||||
|
||||
return view('lms.settings.periode.periode', compact('periodes'));
|
||||
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
|
||||
$periode = Periode::findOrFail($id);
|
||||
|
||||
return view('lms.settings.periode.edit', compact('periode'));
|
||||
|
||||
}
|
||||
|
||||
public function update($id, PeriodeRequest $request)
|
||||
{
|
||||
$periode = Periode::findOrFail($id);
|
||||
|
||||
$input = $request->all();
|
||||
|
||||
$periode->update($input);
|
||||
|
||||
//process
|
||||
$tglSekarang = time();
|
||||
|
||||
$students = Student::get();
|
||||
|
||||
foreach ($students as $student) {
|
||||
|
||||
$dateDiff = $tglSekarang - $student['registered_at'];
|
||||
$durasi = floor($dateDiff/(60 * 60 * 24));
|
||||
$periodes = Periode::first();
|
||||
if($durasi > $periodes['days']){
|
||||
$student->update(['status' => 0]);
|
||||
}
|
||||
else{
|
||||
$student->update(['status' => 1]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
session()->flash('flash_message', 'You have been updated periode!');
|
||||
|
||||
return redirect()->route('settings.periode');
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
83
app/Http/Controllers/ShelfController.php
Executable file
83
app/Http/Controllers/ShelfController.php
Executable file
|
@ -0,0 +1,83 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Shelf;
|
||||
use App\Http\Requests\ShelfRequest;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ShelfController extends Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
$this->middleware('auth');
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$shelves = Shelf::get();
|
||||
|
||||
return view('lms.settings.shelf.shelf', compact('shelves'));
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
|
||||
return view('lms.settings.shelf.add');
|
||||
|
||||
}
|
||||
|
||||
public function store(ShelfRequest $request)
|
||||
{
|
||||
|
||||
$input = $request->all();
|
||||
|
||||
$shelf = Shelf::create($input);
|
||||
|
||||
//flash messaging
|
||||
session()->flash('flash_message', 'You have been added 1 shelf!');
|
||||
|
||||
return redirect()->route('settings.shelf');
|
||||
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
|
||||
$shelf = Shelf::findOrFail($id);
|
||||
|
||||
return view('lms.settings.shelf.edit', compact('shelf'));
|
||||
|
||||
}
|
||||
|
||||
public function update($id, ShelfRequest $request)
|
||||
{
|
||||
|
||||
$shelf = Shelf::findOrFail($id);
|
||||
|
||||
$input = $request->all();
|
||||
|
||||
$shelf->update($input);
|
||||
|
||||
session()->flash('flash_message', 'You have been updated 1 shelf!');
|
||||
|
||||
return redirect()->route('settings.shelf');
|
||||
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
|
||||
$shelf = Shelf::findOrFail($id);
|
||||
|
||||
$shelf->delete();
|
||||
|
||||
session()->flash('flash_message', 'You have been deleted 1 shelf!');
|
||||
|
||||
return redirect()->route('settings.shelf');
|
||||
|
||||
}
|
||||
|
||||
}
|
114
app/Http/Controllers/StudentController.php
Executable file
114
app/Http/Controllers/StudentController.php
Executable file
|
@ -0,0 +1,114 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Student;
|
||||
use App\Http\Requests\StudentRequest;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class StudentController extends Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
$this->middleware('auth');
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$students = Student::get();
|
||||
|
||||
return view('lms.settings.student.student', compact('students'));
|
||||
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
|
||||
return view('lms.settings.student.add');
|
||||
|
||||
}
|
||||
|
||||
public function store(StudentRequest $request)
|
||||
{
|
||||
|
||||
$input = $request->all();
|
||||
|
||||
$input['registered_at'] = time();
|
||||
|
||||
$student = Student::create($input);
|
||||
|
||||
return redirect()->route('settings.student');
|
||||
|
||||
session()->flash('flash_message', 'You have been added 1 student!');
|
||||
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
|
||||
$student = Student::findOrFail($id);
|
||||
|
||||
return view('lms.settings.student.edit', compact('student'));
|
||||
|
||||
}
|
||||
|
||||
public function update($id, StudentRequest $request)
|
||||
{
|
||||
|
||||
$student = Student::findOrFail($id);
|
||||
|
||||
$input = $request->all();
|
||||
|
||||
$student->update($input);
|
||||
|
||||
session()->flash('flash_message', 'You have been updated 1 student!');
|
||||
|
||||
return redirect()->route('settings.student');
|
||||
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
|
||||
$student = Student::findOrFail($id);
|
||||
|
||||
$student->delete();
|
||||
|
||||
session()->flash('flash_message', 'You have been deleted 1 student!');
|
||||
|
||||
return redirect()->route('settings.student');
|
||||
|
||||
}
|
||||
|
||||
public function down($id)
|
||||
{
|
||||
|
||||
$student = Student::findOrFail($id);
|
||||
|
||||
$student->update(['status' => 0, 'registered_at' => 12960000]);
|
||||
|
||||
session()->flash('flash_message', 'Anda telah mematikan masa aktif 1 siswa!');
|
||||
|
||||
return redirect()->route('settings.student');
|
||||
|
||||
}
|
||||
|
||||
public function up($id)
|
||||
{
|
||||
$dateNow = time();
|
||||
|
||||
$student = Student::findOrFail($id);
|
||||
|
||||
$student->update(['status' => 1, 'registered_at' => $dateNow]);
|
||||
|
||||
session()->flash('flash_message', 'Anda telah melakukan perpanjangan masa aktif siswa!');
|
||||
|
||||
return redirect()->route('settings.student');
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue