├── public ├── favicon.ico ├── robots.txt ├── css │ ├── app.css │ └── theme │ │ ├── .DS_Store │ │ └── assets │ │ ├── .DS_Store │ │ ├── img │ │ ├── ny.jpg │ │ ├── .DS_Store │ │ ├── lorde.jpg │ │ ├── mask.png │ │ ├── ui-sam.jpg │ │ ├── ui-zac.jpg │ │ ├── zoom.png │ │ ├── blog-bg.jpg │ │ ├── login-bg.jpg │ │ ├── product.jpg │ │ ├── product.png │ │ ├── ui-danro.jpg │ │ ├── ui-divya.jpg │ │ ├── weather.jpg │ │ ├── instagram.jpg │ │ ├── profile-01.jpg │ │ ├── profile-02.jpg │ │ ├── radio-gray.png │ │ ├── ui-sherman.jpg │ │ ├── checkbox-gray.png │ │ ├── friends │ │ │ ├── .DS_Store │ │ │ ├── fr-01.jpg │ │ │ ├── fr-02.jpg │ │ │ ├── fr-03.jpg │ │ │ ├── fr-04.jpg │ │ │ ├── fr-05.jpg │ │ │ ├── fr-06.jpg │ │ │ ├── fr-07.jpg │ │ │ ├── fr-08.jpg │ │ │ ├── fr-09.jpg │ │ │ ├── fr-10.jpg │ │ │ └── fr-11.jpg │ │ └── portfolio │ │ │ ├── .DS_Store │ │ │ ├── port01.jpg │ │ │ ├── port02.jpg │ │ │ ├── port03.jpg │ │ │ ├── port04.jpg │ │ │ ├── port05.jpg │ │ │ └── port06.jpg │ │ ├── css │ │ ├── .DS_Store │ │ ├── to-do.css │ │ ├── table-responsive.css │ │ └── zabuto_calendar.css │ │ ├── js │ │ ├── .DS_Store │ │ ├── fancybox │ │ │ └── .DS_Store │ │ ├── gritter │ │ │ ├── .DS_Store │ │ │ ├── css │ │ │ │ ├── .DS_Store │ │ │ │ ├── jquery.gritter0.css │ │ │ │ └── jquery.gritter.css │ │ │ ├── js │ │ │ │ └── .DS_Store │ │ │ └── images │ │ │ │ ├── .DS_Store │ │ │ │ ├── gritter.png │ │ │ │ ├── ie-spacer.gif │ │ │ │ ├── gritter-long.png │ │ │ │ └── gritter-light.png │ │ ├── chart-master │ │ │ └── .DS_Store │ │ ├── fullcalendar │ │ │ └── .DS_Store │ │ ├── bootstrap-inputmask │ │ │ └── .DS_Store │ │ ├── jquery-easy-pie-chart │ │ │ ├── .DS_Store │ │ │ └── jquery.easy-pie-chart.css │ │ ├── tasks.js │ │ ├── easy-pie-chart.js │ │ ├── jquery.ui.touch-punch.min.js │ │ ├── jquery.scrollTo.min.js │ │ ├── common-scripts.js │ │ ├── jquery.backstretch.min.js │ │ ├── morris-conf.js │ │ ├── chartjs-conf.js │ │ └── calendar-conf-events.js │ │ ├── fonts │ │ ├── .DS_Store │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ │ ├── lineicons │ │ ├── .DS_Store │ │ ├── fonts │ │ │ ├── .DS_Store │ │ │ ├── linecons.eot │ │ │ ├── linecons.ttf │ │ │ └── linecons.woff │ │ └── lte-ie7.js │ │ └── font-awesome │ │ ├── .DS_Store │ │ ├── css │ │ └── .DS_Store │ │ └── fonts │ │ ├── .DS_Store │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ └── fontawesome-webfont.woff ├── images │ ├── favicon.ico │ ├── sort_asc.png │ ├── sort_both.png │ ├── sort_desc.png │ ├── sort_asc_disabled.png │ └── sort_desc_disabled.png ├── fonts │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ ├── fontawesome-webfont.woff2 │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── img │ ├── 29e121948479185bf49cb59f951be420.jpg │ ├── 9a9b2cb4902cdf115b16068d17ac9696.jpg │ └── ab0674de2a82af659964fe82da5e2cae.jpg ├── .htaccess ├── web.config ├── js │ ├── custom.js │ └── dataTables.bootstrap.min.js └── index.php ├── database ├── seeds │ ├── .gitkeep │ ├── DatabaseSeeder.php │ ├── BooksSeeder.php │ ├── poststableseeder.php │ └── UsersSeeder.php ├── .gitignore ├── migrations │ ├── .gitkeep │ ├── 2016_12_12_114448_create_authors_table.php │ ├── 2016_12_11_110857_create_posts_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2016_12_12_120408_create_books_table.php │ ├── 2016_12_30_094623_create_borrow_logs_table.php │ └── 2016_12_11_131056_laratrust_setup_tables.php └── factories │ └── ModelFactory.php ├── resources ├── views │ ├── vendor │ │ ├── .gitkeep │ │ ├── notifications │ │ │ └── email-plain.blade.php │ │ └── pagination │ │ │ ├── simple-default.blade.php │ │ │ ├── simple-bootstrap-4.blade.php │ │ │ ├── default.blade.php │ │ │ └── bootstrap-4.blade.php │ ├── about.blade.php │ ├── datatable │ │ └── _action.blade.php │ ├── welcome.blade.php │ ├── home.blade.php │ ├── authors │ │ ├── _form.blade.php │ │ ├── index.blade.php │ │ ├── create.blade.php │ │ └── edit.blade.php │ ├── layouts │ │ └── _flash.blade.php │ ├── guest │ │ └── index.blade.php │ ├── books │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ ├── index.blade.php │ │ ├── _form.blade.php │ │ └── export.blade.php │ ├── errors │ │ ├── 403.blade.php │ │ ├── 404.blade.php │ │ └── 503.blade.php │ ├── auth │ │ ├── passwords │ │ │ ├── email.blade.php │ │ │ └── reset.blade.php │ │ ├── login.blade.php │ │ └── register.blade.php │ ├── dashboard │ │ ├── admin.blade.php │ │ └── member.blade.php │ └── pdf │ │ └── books.blade.php ├── assets │ ├── sass │ │ ├── app.scss │ │ └── _variables.scss │ └── js │ │ ├── app.js │ │ ├── components │ │ └── Example.vue │ │ └── bootstrap.js └── lang │ └── en │ ├── pagination.php │ ├── auth.php │ └── passwords.php ├── bootstrap ├── cache │ └── .gitignore ├── autoload.php └── app.php ├── storage ├── logs │ └── .gitignore ├── app │ ├── public │ │ └── .gitignore │ └── .gitignore └── framework │ ├── cache │ └── .gitignore │ ├── views │ └── .gitignore │ ├── sessions │ └── .gitignore │ └── .gitignore ├── app ├── Exceptions │ ├── BookException.php │ └── Handler.php ├── Post.php ├── Role.php ├── Permission.php ├── Http │ ├── Controllers │ │ ├── MyController.php │ │ ├── Controller.php │ │ ├── Auth │ │ │ ├── ResetPasswordController.php │ │ │ ├── ForgotPasswordController.php │ │ │ ├── LoginController.php │ │ │ └── RegisterController.php │ │ ├── HomeController.php │ │ ├── GuestController.php │ │ └── AuthorsController.php │ ├── Requests │ │ ├── UpdateBookRequest.php │ │ └── StoreBookRequest.php │ ├── Middleware │ │ ├── EncryptCookies.php │ │ ├── VerifyCsrfToken.php │ │ └── RedirectIfAuthenticated.php │ └── Kernel.php ├── Providers │ ├── AppServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── AuthServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── BorrowLog.php ├── Console │ └── Kernel.php ├── Author.php ├── User.php └── Book.php ├── package.json ├── tests ├── ExampleTest.php └── TestCase.php ├── routes ├── api.php ├── console.php └── web.php ├── config ├── laratrust_seeder.php ├── compile.php ├── services.php ├── view.php ├── broadcasting.php ├── filesystems.php ├── queue.php ├── cache.php ├── auth.php ├── laratrust.php ├── database.php └── mail.php ├── gulpfile.js ├── server.php ├── phpunit.xml ├── composer.json ├── artisan └── readme.md /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /database/seeds/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /database/migrations/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /resources/views/vendor/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /public/css/app.css: -------------------------------------------------------------------------------- 1 | .tab-pane { 2 | padding: 15px 0px 15px 0px; 3 | } 4 | -------------------------------------------------------------------------------- /public/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/images/favicon.ico -------------------------------------------------------------------------------- /public/css/theme/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/.DS_Store -------------------------------------------------------------------------------- /public/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /public/images/sort_asc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/images/sort_asc.png -------------------------------------------------------------------------------- /public/images/sort_both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/images/sort_both.png -------------------------------------------------------------------------------- /public/images/sort_desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/images/sort_desc.png -------------------------------------------------------------------------------- /resources/views/about.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |

dwadada

5 | @endsection 6 | -------------------------------------------------------------------------------- /public/css/theme/assets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/.DS_Store -------------------------------------------------------------------------------- /public/css/theme/assets/img/ny.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/img/ny.jpg -------------------------------------------------------------------------------- /public/images/sort_asc_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/images/sort_asc_disabled.png -------------------------------------------------------------------------------- /public/css/theme/assets/css/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/css/.DS_Store -------------------------------------------------------------------------------- /public/css/theme/assets/img/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/img/.DS_Store -------------------------------------------------------------------------------- /public/css/theme/assets/img/lorde.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/img/lorde.jpg -------------------------------------------------------------------------------- /public/css/theme/assets/img/mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/img/mask.png -------------------------------------------------------------------------------- /public/css/theme/assets/img/ui-sam.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/img/ui-sam.jpg -------------------------------------------------------------------------------- /public/css/theme/assets/img/ui-zac.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/img/ui-zac.jpg -------------------------------------------------------------------------------- /public/css/theme/assets/img/zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/img/zoom.png -------------------------------------------------------------------------------- /public/css/theme/assets/js/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/js/.DS_Store -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /public/images/sort_desc_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/images/sort_desc_disabled.png -------------------------------------------------------------------------------- /public/css/theme/assets/fonts/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/fonts/.DS_Store -------------------------------------------------------------------------------- /public/css/theme/assets/img/blog-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/img/blog-bg.jpg -------------------------------------------------------------------------------- /public/css/theme/assets/img/login-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/img/login-bg.jpg -------------------------------------------------------------------------------- /public/css/theme/assets/img/product.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/img/product.jpg -------------------------------------------------------------------------------- /public/css/theme/assets/img/product.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/img/product.png -------------------------------------------------------------------------------- /public/css/theme/assets/img/ui-danro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/img/ui-danro.jpg -------------------------------------------------------------------------------- /public/css/theme/assets/img/ui-divya.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/img/ui-divya.jpg -------------------------------------------------------------------------------- /public/css/theme/assets/img/weather.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/img/weather.jpg -------------------------------------------------------------------------------- /public/css/theme/assets/img/instagram.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/img/instagram.jpg -------------------------------------------------------------------------------- /public/css/theme/assets/img/profile-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/img/profile-01.jpg -------------------------------------------------------------------------------- /public/css/theme/assets/img/profile-02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/img/profile-02.jpg -------------------------------------------------------------------------------- /public/css/theme/assets/img/radio-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/img/radio-gray.png -------------------------------------------------------------------------------- /public/css/theme/assets/img/ui-sherman.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/img/ui-sherman.jpg -------------------------------------------------------------------------------- /public/css/theme/assets/lineicons/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/verlyananda/UltraLaravel-Perpus/HEAD/public/css/theme/assets/lineicons/.DS_Store -------------------------------------------------------------------------------- /app/Exceptions/BookException.php: -------------------------------------------------------------------------------- 1 | $form_url, 'method' => 'delete', 'class' => 'form-inline js-confirm', 2 | 'data-confirm' => $confirm_message] ) !!} 3 | Ubah | 4 | {!! Form::submit('Hapus', ['class'=>'btn btn-xs btn-danger']) !!} 5 | {!! Form::close()!!} 6 | 7 | -------------------------------------------------------------------------------- /app/Http/Requests/UpdateBookRequest.php: -------------------------------------------------------------------------------- 1 | route('book'); 11 | return $rules; 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /resources/views/welcome.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | @section('content') 3 |
4 |
5 |
6 |
7 |
Halo
8 |
9 | Selamat datang di Ultraviolet Perpus 10 |
11 |
12 |
13 |
14 |
15 | @endsection 16 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | call(UsersSeeder::class); 17 | $this->call(BooksSeeder::class); 18 | // $this->call(UsersTableSeeder::class); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | visit('/') 17 | ->see('Laravel'); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /resources/views/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Dashboard
9 | 10 |
11 | You are logged in! 12 |
13 |
14 |
15 |
16 |
17 | @endsection 18 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | has('name') ? ' has-error' : '' }}"> 2 | {!! Form::label('name', 'Nama', ['class'=>'col-md-2 control-label']) !!} 3 |
4 | {!! Form::text('name', null, ['class'=>'form-control']) !!} 5 | {!! $errors->first('name', '

:message

') !!} 6 |
7 | 8 | 9 |
10 |
11 | {!! Form::submit('Simpan', ['class'=>'btn btn-primary']) !!} 12 |
13 |
14 | 15 | -------------------------------------------------------------------------------- /resources/views/vendor/notifications/email-plain.blade.php: -------------------------------------------------------------------------------- 1 | first(); 12 | BorrowLog::create(['user_id' => $member->id, 'book_id'=>$book1->id, 'is_returned' => 0]); 13 | BorrowLog::create(['user_id' => $member->id, 'book_id'=>$book2->id, 'is_returned' => 0]); 14 | BorrowLog::create(['user_id' => $member->id, 'book_id'=>$book3->id, 'is_returned' => 1]); 15 | } 16 | } -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | user(); 18 | })->middleware('auth:api'); 19 | -------------------------------------------------------------------------------- /database/seeds/poststableseeder.php: -------------------------------------------------------------------------------- 1 | 'Tips Menjadi Android Developer', 'content'=>'lorem ipsum'], 16 | ['title'=>'Eminem Phonomenal Book', 'content'=>'lorem ipsum'], 17 | ['title'=>'Ultraviolet Developer Company', 'content'=>'lorem ipsum'] 18 | ]; 19 | // masukkan data ke database 20 | DB::table('posts')->insert($posts); 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /config/laratrust_seeder.php: -------------------------------------------------------------------------------- 1 | [ 5 | 'superadministrator' => [ 6 | 'users' => 'c,r,u,d', 7 | 'acl' => 'c,r,u,d', 8 | 'profile' => 'r,u' 9 | ], 10 | 'administrator' => [ 11 | 'users' => 'c,r,u,d', 12 | 'profile' => 'r,u' 13 | ], 14 | 'user' => [ 15 | 'profile' => 'r,u' 16 | ], 17 | ], 18 | 'permissions_map' => [ 19 | 'c' => 'create', 20 | 'r' => 'read', 21 | 'u' => 'update', 22 | 'd' => 'delete' 23 | ] 24 | ]; 25 | -------------------------------------------------------------------------------- /resources/views/layouts/_flash.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 5 |
6 | 7 | @if (session()->has('flash_notification.message')) 8 |
9 |
10 | 11 | {!! session()->get('flash_notification.message') !!} 12 |
13 |
14 | @endif 15 |
16 |
17 |
18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | })->describe('Display an inspiring quote'); 19 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | const elixir = require('laravel-elixir'); 2 | 3 | require('laravel-elixir-vue-2'); 4 | 5 | /* 6 | |-------------------------------------------------------------------------- 7 | | Elixir Asset Management 8 | |-------------------------------------------------------------------------- 9 | | 10 | | Elixir provides a clean, fluent API for defining some basic Gulp tasks 11 | | for your Laravel application. By default, we are compiling the Sass 12 | | file for our application, as well as publishing vendor resources. 13 | | 14 | */ 15 | 16 | elixir(mix => { 17 | mix.sass('app.scss') 18 | .webpack('app.js'); 19 | }); 20 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes If Not A Folder... 9 | RewriteCond %{REQUEST_FILENAME} !-d 10 | RewriteRule ^(.*)/$ /$1 [L,R=301] 11 | 12 | # Handle Front Controller... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_FILENAME} !-f 15 | RewriteRule ^ index.php [L] 16 | 17 | # Handle Authorization Header 18 | RewriteCond %{HTTP:Authorization} . 19 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 20 | 21 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); 22 | 23 | return $app; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/BorrowLog.php: -------------------------------------------------------------------------------- 1 | 'boolean',]; 11 | protected $fillable = ['book_id', 'user_id', 'is_returned']; 12 | public function book() 13 | { 14 | return $this->belongsTo('App\Book'); 15 | } 16 | public function user() 17 | { 18 | return $this->belongsTo('App\User'); 19 | } 20 | 21 | 22 | public function scopeReturned($query)//kembalikan 23 | { 24 | return $query->where('is_returned', 1); 25 | } 26 | public function scopeBorrowed($query)//pinjam 27 | { 28 | return $query->where('is_returned', 0); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 21 | return redirect('/home'); 22 | } 23 | 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /resources/assets/js/app.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * First we will load all of this project's JavaScript dependencies which 4 | * include Vue and Vue Resource. This gives a great starting point for 5 | * building robust, powerful web applications using Vue and Laravel. 6 | */ 7 | 8 | require('./bootstrap'); 9 | 10 | /** 11 | * Next, we will create a fresh Vue application instance and attach it to 12 | * the body of the page. From here, you may begin adding components to 13 | * the application, or feel free to tweak this setup for your needs. 14 | */ 15 | 16 | Vue.component('example', require('./components/Example.vue')); 17 | 18 | const app = new Vue({ 19 | el: '#app' 20 | }); 21 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | id === (int) $userId; 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /resources/assets/js/components/Example.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 24 | -------------------------------------------------------------------------------- /resources/views/vendor/pagination/simple-default.blade.php: -------------------------------------------------------------------------------- 1 | @if ($paginator->hasPages()) 2 | 17 | @endif 18 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->registerPolicies(); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'App\Listeners\EventListener', 18 | ], 19 | ]; 20 | 21 | /** 22 | * Register any events for your application. 23 | * 24 | * @return void 25 | */ 26 | public function boot() 27 | { 28 | parent::boot(); 29 | 30 | // 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2016_12_12_114448_create_authors_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('name'); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('authors'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /resources/views/guest/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 | 7 | 8 |
9 |
10 |
11 |
12 |
13 |
14 |

Daftar Buku

15 |
16 | 17 |
18 | {!! $html->table(['class'=>'table-striped']) !!} 19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | 27 | 28 | @endsection 29 | 30 | @section('scripts') 31 | {!! $html->scripts() !!} 32 | @endsection 33 | 34 | -------------------------------------------------------------------------------- /database/factories/ModelFactory.php: -------------------------------------------------------------------------------- 1 | define(App\User::class, function (Faker\Generator $faker) { 15 | static $password; 16 | 17 | return [ 18 | 'name' => $faker->name, 19 | 'email' => $faker->unique()->safeEmail, 20 | 'password' => $password ?: $password = bcrypt('secret'), 21 | 'remember_token' => str_random(10), 22 | ]; 23 | }); 24 | -------------------------------------------------------------------------------- /database/migrations/2016_12_11_110857_create_posts_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('title')->unique(); 19 | $table->string('content'); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('posts'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /resources/views/vendor/pagination/simple-bootstrap-4.blade.php: -------------------------------------------------------------------------------- 1 | @if ($paginator->hasPages()) 2 | 17 | @endif 18 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token')->index(); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::drop('password_resets'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Requests/StoreBookRequest.php: -------------------------------------------------------------------------------- 1 | 'required|unique:books,title', 29 | 'author_id' => 'required|exists:authors,id', 30 | 'amount' => 'numeric', 31 | 'cover' => 'image|max:2048' 32 | ]; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Passwords must be at least six characters and match the confirmation.', 17 | 'reset' => 'Your password has been reset!', 18 | 'sent' => 'We have e-mailed your password reset link!', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that e-mail address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->string('password'); 21 | $table->rememberToken(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::drop('users'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /resources/views/books/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | @section('content') 3 |
4 |
5 | 6 | 7 |
8 |
9 |
10 |
11 | 16 |
17 |
18 |

Tambah Buku

19 |
20 |
21 | {!! Form::open(['url' => route('books.store'), 22 | 'method' => 'post', 'enctype'=>'multipart/form-data','files'=>'true', 'class'=>'form-horizontal']) !!} 23 | @include('books._form') 24 | {!! Form::close() !!} 25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | @endsection 33 | -------------------------------------------------------------------------------- /resources/views/errors/403.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | No access. 5 | 7 | 34 | 35 | 36 |
37 |
38 |
:(
39 |

Maaf, Anda tidak memiliki akses untuk fitur ini.

40 |

Kembali ke halaman awal

41 |
42 |
43 | 44 | -------------------------------------------------------------------------------- /resources/views/errors/404.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | No access. 5 | 7 | 34 | 35 | 36 |
37 |
38 |
:(
39 |

Maaf, Anda tidak memiliki akses untuk fitur ini.

40 |

Kembali ke halaman awal

41 |
42 |
43 | 44 | -------------------------------------------------------------------------------- /database/seeds/UsersSeeder.php: -------------------------------------------------------------------------------- 1 | name = "admin"; 12 | $adminRole->display_name = "Admin"; 13 | $adminRole->save(); 14 | // Membuat role member 15 | $memberRole = new Role(); 16 | $memberRole->name = "member"; 17 | $memberRole->display_name = "Member"; 18 | $memberRole->save(); 19 | // Membuat sample admin 20 | $admin = new User(); 21 | $admin->name = 'Admin Ultraviolet'; 22 | $admin->email = 'ultraviolet@gmail.com'; 23 | $admin->password = bcrypt('verly123'); 24 | $admin->save(); 25 | $admin->attachRole($adminRole); 26 | // Membuat sample member 27 | $member = new User(); 28 | $member->name = "Sample Member"; 29 | $member->email = 'member@gmail.com'; 30 | $member->password = bcrypt('rahasia'); 31 | $member->save(); 32 | $member->attachRole($memberRole); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /resources/assets/sass/_variables.scss: -------------------------------------------------------------------------------- 1 | 2 | // Body 3 | $body-bg: #f5f8fa; 4 | 5 | // Borders 6 | $laravel-border-color: darken($body-bg, 10%); 7 | $list-group-border: $laravel-border-color; 8 | $navbar-default-border: $laravel-border-color; 9 | $panel-default-border: $laravel-border-color; 10 | $panel-inner-border: $laravel-border-color; 11 | 12 | // Brands 13 | $brand-primary: #3097D1; 14 | $brand-info: #8eb4cb; 15 | $brand-success: #2ab27b; 16 | $brand-warning: #cbb956; 17 | $brand-danger: #bf5329; 18 | 19 | // Typography 20 | $font-family-sans-serif: "Raleway", sans-serif; 21 | $font-size-base: 14px; 22 | $line-height-base: 1.6; 23 | $text-color: #636b6f; 24 | 25 | // Navbar 26 | $navbar-default-bg: #fff; 27 | 28 | // Buttons 29 | $btn-default-color: $text-color; 30 | 31 | // Inputs 32 | $input-border: lighten($text-color, 40%); 33 | $input-border-focus: lighten($brand-primary, 25%); 34 | $input-color-placeholder: lighten($text-color, 30%); 35 | 36 | // Panels 37 | $panel-default-heading-bg: #fff; 38 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 28 | // ->hourly(); 29 | } 30 | 31 | /** 32 | * Register the Closure based commands for the application. 33 | * 34 | * @return void 35 | */ 36 | protected function commands() 37 | { 38 | require base_path('routes/console.php'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /public/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /resources/views/authors/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 | 7 | 8 |
9 |
10 |
11 |
12 | 16 |
17 |
18 |

Penulis

19 |
20 | 21 |
22 |

Tambah

23 | {!! $html->table(['class'=>'table-striped']) !!} 24 |
25 |
26 |
27 |
28 |
29 | 30 | @endsection 31 | 32 | @section('scripts') 33 | {!! $html->scripts() !!} 34 | @endsection 35 | -------------------------------------------------------------------------------- /database/migrations/2016_12_12_120408_create_books_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('title'); 19 | $table->integer('author_id')->unsigned(); 20 | $table->integer('amount')->unsigned(); 21 | $table->string('cover')->nullable(); 22 | $table->timestamps(); 23 | $table->foreign('author_id')->references('id')->on('authors') 24 | ->onUpdate('cascade')->onDelete('cascade'); 25 | 26 | }); 27 | } 28 | 29 | /** 30 | * Reverse the migrations. 31 | * 32 | * @return void 33 | */ 34 | public function down() 35 | { 36 | Schema::dropIfExists('books'); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests 14 | 15 | 16 | 17 | 18 | ./app 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /resources/views/authors/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 | 7 | 8 |
9 |
10 |
11 |
12 | 17 |
18 |
19 |

Tambah Penulis

20 |
21 | 22 |
23 | {!! Form::open(['url' => route('authors.store'), 24 | 'method' => 'post', 'class'=>'form-horizontal']) !!} 25 | @include('authors._form') 26 | {!! Form::close() !!} 27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | 35 | 36 | @endsection 37 | 38 | -------------------------------------------------------------------------------- /database/migrations/2016_12_30_094623_create_borrow_logs_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->integer('book_id')->unsigned()->index(); 19 | $table->foreign('book_id')->references('id')->on('books') 20 | ->onDelete('cascade') 21 | ->onUpdate('cascade'); 22 | $table->integer('user_id')->unsigned()->index(); 23 | $table->foreign('user_id')->references('id')->on('users') 24 | ->onDelete('cascade') 25 | ->onUpdate('cascade'); 26 | $table->boolean('is_returned')->default(false); 27 | $table->timestamps(); 28 | }); 29 | } 30 | 31 | /** 32 | * Reverse the migrations. 33 | * 34 | * @return void 35 | */ 36 | public function down() 37 | { 38 | Schema::dropIfExists('borrow_logs'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /config/compile.php: -------------------------------------------------------------------------------- 1 | [ 17 | // 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled File Providers 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may list service providers which define a "compiles" function 26 | | that returns additional files that should be compiled, providing an 27 | | easy way to get common files from any packages you are utilizing. 28 | | 29 | */ 30 | 31 | 'providers' => [ 32 | // 33 | ], 34 | 35 | ]; 36 | -------------------------------------------------------------------------------- /resources/views/authors/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 | 7 | 8 |
9 |
10 |
11 |
12 | 17 |
18 |
19 |

Ubah Penulis

20 |
21 | 22 |
23 | {!! Form::model($author, ['url' => route('authors.update', $author->id), 24 | 'method'=>'put', 'class'=>'form-horizontal']) !!} 25 | @include('authors._form') 26 | {!! Form::close() !!} 27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | 35 | @endsection 36 | 37 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest', ['except' => 'logout']); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | ], 21 | 22 | 'ses' => [ 23 | 'key' => env('SES_KEY'), 24 | 'secret' => env('SES_SECRET'), 25 | 'region' => 'us-east-1', 26 | ], 27 | 28 | 'sparkpost' => [ 29 | 'secret' => env('SPARKPOST_SECRET'), 30 | ], 31 | 32 | 'stripe' => [ 33 | 'model' => App\User::class, 34 | 'key' => env('STRIPE_KEY'), 35 | 'secret' => env('STRIPE_SECRET'), 36 | ], 37 | 38 | ]; 39 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | realpath(base_path('resources/views')), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => realpath(storage_path('framework/views')), 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /app/Http/Controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 20 | } 21 | 22 | /** 23 | * Show the application dashboard. 24 | * 25 | * @return \Illuminate\Http\Response 26 | */ 27 | public function index() 28 | { 29 | if (Laratrust::hasRole('admin')) return $this->adminDashboard(); 30 | if (Laratrust::hasRole('member')) return $this->memberDashboard(); 31 | 32 | return view('home'); 33 | } 34 | 35 | protected function adminDashboard() 36 | { 37 | return view('dashboard.admin'); 38 | } 39 | protected function memberDashboard() 40 | { 41 | $borrowLogs = Auth::user()->borrowLogs()->borrowed()->get(); 42 | return view('dashboard.member', compact('borrowLogs')); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /resources/views/books/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 | 7 | 8 |
9 |
10 |
11 |
12 |
13 | 18 |
19 |
20 |

Ubah Buku

21 |
22 | 23 |
24 | {!! Form::model($book, ['url' => route('books.update', $book->id), 25 | 'method' => 'put', 'files'=>'true', 'class'=>'form-horizontal']) !!} 26 | @include('books._form') 27 | {!! Form::close() !!} 28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | 36 | 37 | @endsection 38 | -------------------------------------------------------------------------------- /resources/views/books/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 | 7 | 8 |
9 |
10 |
11 |
12 | 16 |
17 |
18 |

Buku

19 |
20 | 21 |
22 |

23 | Tambah 24 | Export 25 |

26 | {!! $html->table(['class'=>'table-striped']) !!} 27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | 35 | 36 | @endsection 37 | 38 | @section('scripts') 39 | {!! $html->scripts() !!} 40 | @endsection 41 | 42 | -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | books->count() > 0) { 19 | // menyiapkan pesan error 20 | $html = 'Penulis tidak bisa dihapus karena masih memiliki buku : '; 21 | $html .= ''; 26 | 27 | Session::flash("flash_notification", [ 28 | "level"=>"danger", 29 | "message"=>$html 30 | ]); 31 | 32 | // membatalkan proses penghapusan 33 | return false; 34 | } 35 | }); 36 | } 37 | 38 | public function books()//panggil model books 39 | { 40 | return $this->hasMany('App\Book'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /public/css/theme/assets/js/easy-pie-chart.js: -------------------------------------------------------------------------------- 1 | var Script = function () { 2 | 3 | // easy pie chart 4 | 5 | $('.percentage').easyPieChart({ 6 | animate: 1000, 7 | size: 135, 8 | barColor:'#ff6c60' 9 | }); 10 | $('.percentage-light').easyPieChart({ 11 | barColor: function(percent) { 12 | percent /= 100; 13 | return "rgb(" + Math.round(255 * (1-percent)) + ", " + Math.round(255 * percent) + ", 0)"; 14 | }, 15 | trackColor: '#666', 16 | scaleColor: false, 17 | lineCap: 'butt', 18 | lineWidth: 15, 19 | animate: 1000 20 | }); 21 | 22 | $('.update-easy-pie-chart').click(function(){ 23 | $('.easy-pie-chart .percentage').each(function() { 24 | var newValue = Math.floor(100*Math.random()); 25 | $(this).data('easyPieChart').update(newValue); 26 | $('span', this).text(newValue); 27 | }); 28 | }); 29 | 30 | $('.updateEasyPieChart').on('click', function(e) { 31 | e.preventDefault(); 32 | $('.percentage, .percentage-light').each(function() { 33 | var newValue = Math.round(100*Math.random()); 34 | $(this).data('easyPieChart').update(newValue); 35 | $('span', this).text(newValue); 36 | }); 37 | }); 38 | 39 | }(); -------------------------------------------------------------------------------- /app/Http/Controllers/GuestController.php: -------------------------------------------------------------------------------- 1 | ajax()) { 18 | $books = Book::with('author'); 19 | return Datatables::of($books) 20 | ->addColumn('stock', function($book){ 21 | return $book->stock; 22 | }) 23 | ->addColumn('action', function($book){ 24 | if (Laratrust::hasRole('admin')) return '';// jika admin tidak muncul tombol pinjam 25 | return 'Pinjam'; 26 | })->make(true); 27 | } 28 | $html = $htmlBuilder 29 | ->addColumn(['data' => 'title', 'name'=>'title', 'title'=>'Judul']) 30 | ->addColumn(['data' => 'stock', 'name'=>'stock', 'title'=>'Stok', 'orderable'=>false, 'searchable'=>false]) 31 | ->addColumn(['data' => 'author.name', 'name'=>'author.name', 'title'=>'Penulis']) 32 | ->addColumn(['data' => 'action', 'name'=>'action', 'title'=>'', 'orderable'=>false, 'searchable'=>false]); 33 | return view('guest.index')->with(compact('html')); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /resources/views/errors/503.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Be right back. 5 | 6 | 7 | 8 | 39 | 40 | 41 |
42 |
43 |
Be right back.
44 |
45 |
46 | 47 | 48 | -------------------------------------------------------------------------------- /public/css/theme/assets/js/jquery.ui.touch-punch.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI Touch Punch 0.2.3 3 | * 4 | * Copyright 2011–2014, Dave Furfero 5 | * Dual licensed under the MIT or GPL Version 2 licenses. 6 | * 7 | * Depends: 8 | * jquery.ui.widget.js 9 | * jquery.ui.mouse.js 10 | */ 11 | !function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery); -------------------------------------------------------------------------------- /resources/views/auth/passwords/email.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |
9 |
Reset Password
10 |
11 | @if (session('status')) 12 |
13 | {{ session('status') }} 14 |
15 | @endif 16 | 17 | {!! Form::open(['url'=>'/password/email', 'class'=>'form-horizontal'])!!} 18 |
19 | {!! Form::label('email', 'Alamat Email', ['class'=>'col-md-4 control-label']) !!} 20 |
21 | {!! Form::email('email', null, ['class'=>'form-control']) !!} 22 | {!! $errors->first('email', '

:message

') !!} 23 |
24 |
25 |
26 |
27 | 30 |
31 |
32 | {!! Form::close() !!} 33 | 34 |
35 |
36 |
37 |
38 |
39 | @endsection 40 | -------------------------------------------------------------------------------- /resources/views/vendor/pagination/default.blade.php: -------------------------------------------------------------------------------- 1 | @if ($paginator->hasPages()) 2 | 36 | @endif 37 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | 'admin', 'middleware'=>['auth', 'role:admin']], function () { 19 | Route::resource('authors', 'AuthorsController'); 20 | Route::resource('books', 'BooksController'); 21 | Route::get('export/books', [ 22 | 'as' => 'export.books', 23 | 'uses' => 'BooksController@export' 24 | ]); 25 | Route::post('export/books', [ 26 | 'as' => 'export.books.post', 27 | 'uses' => 'BooksController@exportPost' 28 | ]); 29 | }); 30 | 31 | Route::get('books/{book}/borrow', [ 32 | 'middleware' => ['auth', 'role:member'], 33 | 'as' => 'guest.books.borrow', 34 | 'uses' => 'BooksController@borrow' 35 | ]); 36 | 37 | Route::put('books/{book}/return', [ 38 | 'middleware' => ['auth', 'role:member'], 39 | 'as' => 'member.books.return', 40 | 'uses' => 'BooksController@returnBack' 41 | ]); 42 | 43 | -------------------------------------------------------------------------------- /public/js/custom.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | // confirm delete 3 | $(document.body).on('submit', '.js-confirm', function () { 4 | var $el = $(this) 5 | var text = $el.data('confirm') ? $el.data('confirm') : 'Anda yakin melakukan tindakan ini?' 6 | var c = confirm(text); 7 | return c; 8 | }); 9 | 10 | // add selectize to select element 11 | $('.js-selectize').selectize({ 12 | sortField: 'text' 13 | }); 14 | 15 | // delete review book 16 | $(document.body).on('submit', '.js-review-delete', function () { 17 | var $el = $(this); 18 | var text = $el.data('confirm') ? $el.data('confirm') : 'Anda yakin melakukan tindakan ini?'; 19 | var c = confirm(text); 20 | // cancel delete 21 | if (c === false) return c; 22 | 23 | // delete via ajax 24 | // disable behaviour default dari tombol submit 25 | event.preventDefault(); 26 | // hapus data buku dengan ajax 27 | $.ajax({ 28 | type : 'POST', 29 | url : $(this).attr('action'), 30 | dataType : 'json', 31 | data : { 32 | _method : 'DELETE', 33 | // menambah csrf token dari Laravel 34 | _token : $( this ).children( 'input[name=_token]' ).val() 35 | } 36 | }).done(function(data) { 37 | // cari baris yang dihapus 38 | baris = $('#form-'+data.id).closest('tr'); 39 | // hilangkan baris (fadeout kemudian remove) 40 | baris.fadeOut(300, function() {$(this).remove()}); 41 | }); 42 | }); 43 | }); 44 | 45 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | stock < 1) { 38 | throw new BookException("Buku $book->title sedang tidak tersedia."); 39 | } 40 | 41 | // cek apakah buku ini sedang dipinjam oleh user 42 | if($this->borrowLogs()->where('book_id',$book->id)->where('is_returned', 0)->count() > 0 ) { 43 | throw new BookException("Buku $book->title sedang Anda pinjam."); 44 | } 45 | 46 | $borrowLog = BorrowLog::create(['user_id'=>$this->id, 'book_id'=>$book->id]); 47 | return $borrowLog; 48 | } 49 | 50 | public function borrowLogs() 51 | { 52 | return $this->hasMany('App\BorrowLog'); 53 | } 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /resources/assets/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | 2 | window._ = require('lodash'); 3 | 4 | /** 5 | * We'll load jQuery and the Bootstrap jQuery plugin which provides support 6 | * for JavaScript based Bootstrap features such as modals and tabs. This 7 | * code may be modified to fit the specific needs of your application. 8 | */ 9 | 10 | window.$ = window.jQuery = require('jquery'); 11 | require('bootstrap-sass'); 12 | 13 | /** 14 | * Vue is a modern JavaScript library for building interactive web interfaces 15 | * using reactive data binding and reusable components. Vue's API is clean 16 | * and simple, leaving you to focus on building your next great project. 17 | */ 18 | 19 | window.Vue = require('vue'); 20 | require('vue-resource'); 21 | 22 | /** 23 | * We'll register a HTTP interceptor to attach the "CSRF" header to each of 24 | * the outgoing requests issued by this application. The CSRF middleware 25 | * included with Laravel will automatically verify the header's value. 26 | */ 27 | 28 | Vue.http.interceptors.push((request, next) => { 29 | request.headers.set('X-CSRF-TOKEN', Laravel.csrfToken); 30 | 31 | next(); 32 | }); 33 | 34 | /** 35 | * Echo exposes an expressive API for subscribing to channels and listening 36 | * for events that are broadcast by Laravel. Echo and event broadcasting 37 | * allows your team to easily build robust real-time web applications. 38 | */ 39 | 40 | // import Echo from "laravel-echo" 41 | 42 | // window.Echo = new Echo({ 43 | // broadcaster: 'pusher', 44 | // key: 'your-pusher-key' 45 | // }); 46 | -------------------------------------------------------------------------------- /resources/views/dashboard/admin.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | @section('content') 3 |
4 |
5 | 6 |
7 |
8 |

Dashboard

9 |
10 |
11 | Selamat datang di Menu Admin Ultraviolet Perpus. Silahkan pilih menu yang diinginkan. 12 |
13 |
14 |
15 |
16 | 17 | 18 | @endsection 19 | 20 | @section('scripts') 21 | 41 | @endsection -------------------------------------------------------------------------------- /resources/views/vendor/pagination/bootstrap-4.blade.php: -------------------------------------------------------------------------------- 1 | @if ($paginator->hasPages()) 2 | 36 | @endif 37 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "description": "The Laravel Framework.", 4 | "keywords": ["framework", "laravel"], 5 | "license": "MIT", 6 | "type": "project", 7 | "require": { 8 | "php": ">=5.6.4", 9 | "laravel/framework": "5.3.*", 10 | "laravelcollective/html": "~5.3", 11 | "santigarcor/laratrust": "3.0.*", 12 | "yajra/laravel-datatables-oracle": "~6.0", 13 | "barryvdh/laravel-dompdf": "~0.7" 14 | }, 15 | "require-dev": { 16 | "fzaninotto/faker": "~1.4", 17 | "mockery/mockery": "0.9.*", 18 | "phpunit/phpunit": "~5.0", 19 | "symfony/css-selector": "3.1.*", 20 | "symfony/dom-crawler": "3.1.*" 21 | }, 22 | "autoload": { 23 | "classmap": [ 24 | "database" 25 | ], 26 | "psr-4": { 27 | "App\\": "app/" 28 | } 29 | }, 30 | "autoload-dev": { 31 | "classmap": [ 32 | "tests/TestCase.php" 33 | ] 34 | }, 35 | "scripts": { 36 | "post-root-package-install": [ 37 | "php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 38 | ], 39 | "post-create-project-cmd": [ 40 | "php artisan key:generate" 41 | ], 42 | "post-install-cmd": [ 43 | "Illuminate\\Foundation\\ComposerScripts::postInstall", 44 | "php artisan optimize" 45 | ], 46 | "post-update-cmd": [ 47 | "Illuminate\\Foundation\\ComposerScripts::postUpdate", 48 | "php artisan optimize" 49 | ] 50 | }, 51 | "config": { 52 | "preferred-install": "dist" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/Book.php: -------------------------------------------------------------------------------- 1 | amount < $book->borrowed) { 19 | Session::flash("flash_notification", [ 20 | "level"=>"danger", 21 | "message"=>"Jumlah buku $book->title harus >= " . $book->borrowed 22 | ]); 23 | return false; 24 | } 25 | }); 26 | 27 | self::deleting(function($book) 28 | { 29 | if ($book->borrowLogs()->count() > 0) { 30 | Session::flash("flash_notification", [ 31 | "level"=>"danger", 32 | "message"=>"Buku $book->title sedang dipinjam." 33 | ]); 34 | return false; 35 | } 36 | }); 37 | } 38 | 39 | public function author() 40 | { 41 | return $this->belongsTo('App\Author'); 42 | } 43 | 44 | public function borrowLogs() 45 | { 46 | return $this->hasMany('App\BorrowLog'); 47 | } 48 | 49 | public function getStockAttribute() 50 | { 51 | $borrowed = $this->borrowLogs()->borrowed()->count(); 52 | $stock = $this->amount - $borrowed; 53 | return $stock; 54 | } 55 | 56 | public function getBorrowedAttribute() 57 | { 58 | return $this->borrowLogs()->borrowed()->count(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_KEY'), 36 | 'secret' => env('PUSHER_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | // 40 | ], 41 | ], 42 | 43 | 'redis' => [ 44 | 'driver' => 'redis', 45 | 'connection' => 'default', 46 | ], 47 | 48 | 'log' => [ 49 | 'driver' => 'log', 50 | ], 51 | 52 | 'null' => [ 53 | 'driver' => 'null', 54 | ], 55 | 56 | ], 57 | 58 | ]; 59 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 32 | 33 | $status = $kernel->handle( 34 | $input = new Symfony\Component\Console\Input\ArgvInput, 35 | new Symfony\Component\Console\Output\ConsoleOutput 36 | ); 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Shutdown The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once Artisan has finished running. We will fire off the shutdown events 44 | | so that any final work may be done by the application before we shut 45 | | down the process. This is the last thing to happen to the request. 46 | | 47 | */ 48 | 49 | $kernel->terminate($input, $status); 50 | 51 | exit($status); 52 | -------------------------------------------------------------------------------- /resources/views/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | 5 | 6 | 7 | 10 | 11 |
12 |
13 | {!! Form::open(['url'=>'login', 'class'=>'form-horizontal']) !!} 14 | 40 | 41 |
42 |
43 | 44 | 45 | 46 | @endsection 47 | -------------------------------------------------------------------------------- /public/js/dataTables.bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | DataTables Bootstrap 3 integration 3 | ©2011-2015 SpryMedia Ltd - datatables.net/license 4 | */ 5 | (function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,d){a||(a=window);if(!d||!d.fn.dataTable)d=require("datatables.net")(a,d).$;return b(d,a,a.document)}:b(jQuery,window,document)})(function(b,a,d){var f=b.fn.dataTable;b.extend(!0,f.defaults,{dom:"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-5'i><'col-sm-7'p>>",renderer:"bootstrap"});b.extend(f.ext.classes, 6 | {sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm",sProcessing:"dataTables_processing panel panel-default"});f.ext.renderer.pageButton.bootstrap=function(a,h,r,m,j,n){var o=new f.Api(a),s=a.oClasses,k=a.oLanguage.oPaginate,t=a.oLanguage.oAria.paginate||{},e,g,p=0,q=function(d,f){var l,h,i,c,m=function(a){a.preventDefault();!b(a.currentTarget).hasClass("disabled")&&o.page()!=a.data.action&&o.page(a.data.action).draw("page")}; 7 | l=0;for(h=f.length;l",{"class":s.sPageButton+" "+g,id:0===r&&"string"===typeof c?a.sTableId+"_"+c:null}).append(b("",{href:"#", 8 | "aria-controls":a.sTableId,"aria-label":t[c],"data-dt-idx":p,tabindex:a.iTabIndex}).html(e)).appendTo(d),a.oApi._fnBindAction(i,{action:c},m),p++)}},i;try{i=b(h).find(d.activeElement).data("dt-idx")}catch(u){}q(b(h).empty().html('