├── public ├── favicon.ico ├── robots.txt ├── mix-manifest.json ├── .htaccess └── index.php ├── resources ├── css │ └── app.css ├── js │ ├── app.js │ └── bootstrap.js ├── sass │ ├── _variables.scss │ └── app.scss └── views │ ├── jabatan │ ├── actions.blade.php │ ├── show.blade.php │ ├── index.blade.php │ ├── create.blade.php │ └── edit.blade.php │ ├── kategori │ ├── actions.blade.php │ ├── show.blade.php │ ├── index.blade.php │ ├── create.blade.php │ └── edit.blade.php │ ├── pegawai │ ├── actions.blade.php │ ├── show.blade.php │ ├── index.blade.php │ ├── edit.blade.php │ └── create.blade.php │ ├── penjualan │ ├── actions.blade.php │ ├── index.blade.php │ ├── show.blade.php │ ├── create.blade.php │ └── edit.blade.php │ ├── master_barang │ ├── actions.blade.php │ ├── show.blade.php │ ├── index.blade.php │ ├── edit.blade.php │ └── create.blade.php │ ├── home.blade.php │ ├── roles │ ├── show.blade.php │ ├── index.blade.php │ ├── create.blade.php │ └── edit.blade.php │ ├── products │ ├── show.blade.php │ ├── create.blade.php │ ├── edit.blade.php │ └── index.blade.php │ ├── auth │ ├── verify.blade.php │ ├── passwords │ │ ├── email.blade.php │ │ ├── confirm.blade.php │ │ └── reset.blade.php │ ├── login.blade.php │ └── register.blade.php │ ├── users │ ├── show.blade.php │ ├── index.blade.php │ ├── create.blade.php │ └── edit.blade.php │ └── layouts │ ├── default.blade.php │ └── app.blade.php ├── database ├── .gitignore ├── seeders │ ├── DatabaseSeeder.php │ ├── PermissionTableSeeder.php │ └── CreateAdminUserSeeder.php ├── migrations │ ├── 2022_04_15_130157_create_products_table.php │ ├── 2023_02_06_143434_create_jabatan_table.php │ ├── 2023_02_06_150906_create_kategori_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2019_08_19_000000_create_failed_jobs_table.php │ ├── 2019_12_14_000001_create_personal_access_tokens_table.php │ ├── 2023_02_06_151018_create_master_barang_table.php │ ├── 2023_02_06_151609_create_penjualan_table.php │ └── 2023_02_06_143655_create_pegawai_table.php └── factories │ └── UserFactory.php ├── bootstrap ├── cache │ └── .gitignore └── app.php ├── storage ├── logs │ └── .gitignore ├── app │ ├── public │ │ └── .gitignore │ └── .gitignore └── framework │ ├── testing │ └── .gitignore │ ├── views │ └── .gitignore │ ├── cache │ ├── data │ │ └── .gitignore │ └── .gitignore │ ├── sessions │ └── .gitignore │ └── .gitignore ├── .gitattributes ├── tests ├── TestCase.php ├── Unit │ └── ExampleTest.php ├── Feature │ └── ExampleTest.php └── CreatesApplication.php ├── .styleci.yml ├── .gitignore ├── app ├── Models │ ├── barang_masuk.php │ ├── product.php │ ├── jabatan.php │ ├── kategori.php │ ├── master_barang.php │ ├── penjualan.php │ ├── pegawai.php │ └── User.php ├── Http │ ├── Middleware │ │ ├── EncryptCookies.php │ │ ├── VerifyCsrfToken.php │ │ ├── PreventRequestsDuringMaintenance.php │ │ ├── TrustHosts.php │ │ ├── TrimStrings.php │ │ ├── Authenticate.php │ │ ├── ValidateSignature.php │ │ ├── TrustProxies.php │ │ └── RedirectIfAuthenticated.php │ ├── Controllers │ │ ├── Controller.php │ │ ├── HomeController.php │ │ ├── HomeController copy.php │ │ ├── Auth │ │ │ ├── ForgotPasswordController.php │ │ │ ├── ResetPasswordController.php │ │ │ ├── LoginController.php │ │ │ ├── ConfirmPasswordController.php │ │ │ ├── VerificationController.php │ │ │ └── RegisterController.php │ │ ├── ProductController.php │ │ ├── fakturController.php │ │ ├── JabatanController.php │ │ ├── PegawaiController.php │ │ └── PenjualanController.php │ └── Kernel.php ├── Providers │ ├── BroadcastServiceProvider.php │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── Console │ └── Kernel.php └── Exceptions │ └── Handler.php ├── .editorconfig ├── vite.config.js ├── lang ├── en │ ├── pagination.php │ ├── auth.php │ └── passwords.php └── en.json ├── webpack.mix.js ├── routes ├── channels.php ├── api.php ├── console.php └── web.php ├── package.json ├── config ├── cors.php ├── services.php ├── view.php ├── hashing.php ├── broadcasting.php ├── sanctum.php ├── filesystems.php ├── queue.php ├── cache.php ├── mail.php ├── auth.php └── logging.php ├── .env.example ├── phpunit.xml ├── artisan └── composer.json /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/css/app.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /resources/js/app.js: -------------------------------------------------------------------------------- 1 | require('./bootstrap'); 2 | -------------------------------------------------------------------------------- /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/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/cache/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /public/mix-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "/js/app.js": "/js/app.js", 3 | "/css/app.css": "/css/app.css" 4 | } 5 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | compiled.php 2 | config.php 3 | down 4 | events.scanned.php 5 | maintenance.php 6 | routes.php 7 | routes.scanned.php 8 | schedule-* 9 | services.json 10 | -------------------------------------------------------------------------------- /resources/sass/_variables.scss: -------------------------------------------------------------------------------- 1 | // Body 2 | $body-bg: #f8fafc; 3 | 4 | // Typography 5 | $font-family-sans-serif: 'Nunito', sans-serif; 6 | $font-size-base: 0.9rem; 7 | $line-height-base: 1.6; 8 | -------------------------------------------------------------------------------- /resources/sass/app.scss: -------------------------------------------------------------------------------- 1 | // Fonts 2 | @import url('https://fonts.googleapis.com/css?family=Nunito'); 3 | 4 | // Variables 5 | @import 'variables'; 6 | 7 | // Bootstrap 8 | @import '~bootstrap/scss/bootstrap'; 9 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.blade.php diff=html 4 | *.css diff=css 5 | *.html diff=html 6 | *.md diff=markdown 7 | *.php diff=php 8 | 9 | /.github export-ignore 10 | CHANGELOG.md export-ignore 11 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import laravel from 'laravel-vite-plugin'; 3 | 4 | export default defineConfig({ 5 | plugins: [ 6 | laravel({ 7 | input: [ 8 | 'resources/sass/app.scss', 9 | 'resources/js/app.js', 10 | ], 11 | refresh: true, 12 | }), 13 | ], 14 | }); 15 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Models/product.php: -------------------------------------------------------------------------------- 1 | create(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Http/Middleware/PreventRequestsDuringMaintenance.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustHosts.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public function hosts() 15 | { 16 | return [ 17 | $this->allSubdomainsOfApplicationUrl(), 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | 'current_password', 16 | 'password', 17 | 'password_confirmation', 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | id) }}" method="POST"> 2 | Show 3 | @can('jabatan-edit') 4 | Edit 5 | @endcan 6 | 7 | 8 | @csrf 9 | @method('DELETE') 10 | @can('jabatan-delete') 11 | 12 | @endcan 13 | -------------------------------------------------------------------------------- /resources/views/kategori/actions.blade.php: -------------------------------------------------------------------------------- 1 |
2 | Show 3 | @can('kategori-edit') 4 | Edit 5 | @endcan 6 | 7 | 8 | @csrf 9 | @method('DELETE') 10 | @can('kategori-delete') 11 | 12 | @endcan 13 |
-------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | id) }}" method="POST"> 2 | Show 3 | @can('master_barang-edit') 4 | Edit 5 | @endcan 6 | 7 | 8 | @csrf 9 | @method('DELETE') 10 | @can('master_barang-delete') 11 | 12 | @endcan 13 | -------------------------------------------------------------------------------- /resources/views/penjualan/actions.blade.php: -------------------------------------------------------------------------------- 1 |
2 | Show 3 | @can('master_barang-edit') 4 | Edit 5 | @endcan 6 | 7 | 8 | @csrf 9 | @method('DELETE') 10 | @can('master_barang-delete') 11 | 12 | @endcan 13 |
-------------------------------------------------------------------------------- /resources/views/master_barang/actions.blade.php: -------------------------------------------------------------------------------- 1 |
2 | Show 3 | @can('master_barang-edit') 4 | Edit 5 | @endcan 6 | 7 | 8 | @csrf 9 | @method('DELETE') 10 | @can('master_barang-delete') 11 | 12 | @endcan 13 |
-------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 18 | return route('login'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/ValidateSignature.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 'fbclid', 16 | // 'utm_campaign', 17 | // 'utm_content', 18 | // 'utm_medium', 19 | // 'utm_source', 20 | // 'utm_term', 21 | ]; 22 | } 23 | -------------------------------------------------------------------------------- /app/Http/Controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 17 | } 18 | 19 | /** 20 | * Show the application dashboard. 21 | * 22 | * @return \Illuminate\Contracts\Support\Renderable 23 | */ 24 | public function index() 25 | { 26 | return view('home'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Models/jabatan.php: -------------------------------------------------------------------------------- 1 | hasMany(pegawai::class); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Http/Controllers/HomeController copy.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 17 | } 18 | 19 | /** 20 | * Show the application dashboard. 21 | * 22 | * @return \Illuminate\Contracts\Support\Renderable 23 | */ 24 | public function index() 25 | { 26 | return view('home'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /webpack.mix.js: -------------------------------------------------------------------------------- 1 | const mix = require('laravel-mix'); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Mix Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Mix provides a clean, fluent API for defining some Webpack build steps 9 | | for your Laravel application. By default, we are compiling the Sass 10 | | file for the application as well as bundling up all the JS files. 11 | | 12 | */ 13 | 14 | mix.js('resources/js/app.js', 'public/js') 15 | .sass('resources/sass/app.scss', 'public/css') 16 | .sourceMaps(); 17 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 18 | }); 19 | -------------------------------------------------------------------------------- /app/Models/kategori.php: -------------------------------------------------------------------------------- 1 | hasMany(master_barang::class); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 18 | return $request->user(); 19 | }); 20 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 19 | })->purpose('Display an inspiring quote'); 20 | -------------------------------------------------------------------------------- /lang/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "The :attribute must contain at least one letter.": "The :attribute must contain at least one letter.", 3 | "The :attribute must contain at least one number.": "The :attribute must contain at least one number.", 4 | "The :attribute must contain at least one symbol.": "The :attribute must contain at least one symbol.", 5 | "The :attribute must contain at least one uppercase and one lowercase letter.": "The :attribute must contain at least one uppercase and one lowercase letter.", 6 | "The given :attribute has appeared in a data leak. Please choose a different :attribute.": "The given :attribute has appeared in a data leak. Please choose a different :attribute." 7 | } 8 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Send Requests To Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "mix", 6 | "watch": "mix watch", 7 | "watch-poll": "mix watch -- --watch-options-poll=1000", 8 | "hot": "mix watch --hot", 9 | "prod": "npm run production", 10 | "production": "mix --production" 11 | }, 12 | "devDependencies": { 13 | "@popperjs/core": "^2.10.2", 14 | "axios": "^0.25", 15 | "bootstrap": "^5.1.3", 16 | "laravel-mix": "^6.0.6", 17 | "lodash": "^4.17.19", 18 | "postcss": "^8.1.14", 19 | "resolve-url-loader": "^5.0.0", 20 | "sass": "^1.32.11", 21 | "sass-loader": "^11.0.1" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'password' => 'The provided password is incorrect.', 18 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 19 | 20 | ]; 21 | -------------------------------------------------------------------------------- /resources/views/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Dashboard') }}
9 | 10 |
11 | @if (session('status')) 12 | 15 | @endif 16 | 17 | {{ __('You are logged in!') }} 18 |
19 |
20 |
21 |
22 |
23 | @endsection 24 | -------------------------------------------------------------------------------- /app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | protected $policies = [ 16 | // 'App\Models\Model' => '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/Http/Middleware/TrustProxies.php: -------------------------------------------------------------------------------- 1 | |string|null 14 | */ 15 | protected $proxies; 16 | 17 | /** 18 | * The headers that should be used to detect proxies. 19 | * 20 | * @var int 21 | */ 22 | protected $headers = 23 | Request::HEADER_X_FORWARDED_FOR | 24 | Request::HEADER_X_FORWARDED_HOST | 25 | Request::HEADER_X_FORWARDED_PORT | 26 | Request::HEADER_X_FORWARDED_PROTO | 27 | Request::HEADER_X_FORWARDED_AWS_ELB; 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | belongsTo(kategori::class, 'id_ketegory', 'id'); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Models/penjualan.php: -------------------------------------------------------------------------------- 1 | belongsTo(master_barang::class, 'kode_barang', 'id'); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire')->hourly(); 19 | } 20 | 21 | /** 22 | * Register the commands for the application. 23 | * 24 | * @return void 25 | */ 26 | protected function commands() 27 | { 28 | $this->load(__DIR__.'/Commands'); 29 | 30 | require base_path('routes/console.php'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2022_04_15_130157_create_products_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->text('detail'); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('products'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Your password has been reset!', 17 | 'sent' => 'We have emailed your password reset link!', 18 | 'throttled' => 'Please wait before retrying.', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that email address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /database/migrations/2023_02_06_143434_create_jabatan_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('nama_jabatan'); 19 | $table->string('gaji'); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('jabatan'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /database/migrations/2023_02_06_150906_create_kategori_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('nama_kategori'); 19 | $table->string('keterangan'); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('kategori'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token'); 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::dropIfExists('password_resets'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/seeders/PermissionTableSeeder.php: -------------------------------------------------------------------------------- 1 | $permission]); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /database/seeders/CreateAdminUserSeeder.php: -------------------------------------------------------------------------------- 1 | 'Ryan Hidayat', 22 | 'email' => 'admin@gmail.com', 23 | 'password' => bcrypt('123456') 24 | ]); 25 | 26 | $role = Role::create(['name' => 'Admin']); 27 | 28 | $permissions = Permission::pluck('id','id')->all(); 29 | 30 | $role->syncPermissions($permissions); 31 | 32 | $user->assignRole([$role->id]); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /config/cors.php: -------------------------------------------------------------------------------- 1 | ['api/*', 'sanctum/csrf-cookie'], 19 | 20 | 'allowed_methods' => ['*'], 21 | 22 | 'allowed_origins' => ['*'], 23 | 24 | 'allowed_origins_patterns' => [], 25 | 26 | 'allowed_headers' => ['*'], 27 | 28 | 'exposed_headers' => [], 29 | 30 | 'max_age' => 0, 31 | 32 | 'supports_credentials' => false, 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->timestamp('email_verified_at')->nullable(); 21 | $table->string('password'); 22 | $table->rememberToken(); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('users'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /resources/views/kategori/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Show Kategori

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 |
18 |
19 |
20 | Nama Kategori: 21 | {{ $kategori->name }} 22 |
23 |
24 |
25 |
26 | Keterangan: 27 | {{ $kategori->detail }} 28 |
29 |
30 |
31 | @endsection 32 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('uuid')->unique(); 19 | $table->text('connection'); 20 | $table->text('queue'); 21 | $table->longText('payload'); 22 | $table->longText('exception'); 23 | $table->timestamp('failed_at')->useCurrent(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('failed_jobs'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 26 | return redirect(RouteServiceProvider::HOME); 27 | } 28 | } 29 | 30 | return $next($request); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Models/pegawai.php: -------------------------------------------------------------------------------- 1 | belongsTo(jabatan::class, 'id_jabatan', 'id'); 29 | } 30 | /** 31 | * Get the user that owns the pegawai 32 | * 33 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo 34 | */ 35 | public function user(): BelongsTo 36 | { 37 | return $this->belongsTo(User::class, 'id_user', 'id'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->morphs('tokenable'); 19 | $table->string('name'); 20 | $table->string('token', 64)->unique(); 21 | $table->text('abilities')->nullable(); 22 | $table->timestamp('last_used_at')->nullable(); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('personal_access_tokens'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | window._ = require('lodash'); 2 | 3 | try { 4 | require('bootstrap'); 5 | } catch (e) {} 6 | 7 | /** 8 | * We'll load the axios HTTP library which allows us to easily issue requests 9 | * to our Laravel back-end. This library automatically handles sending the 10 | * CSRF token as a header based on the value of the "XSRF" token cookie. 11 | */ 12 | 13 | window.axios = require('axios'); 14 | 15 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 16 | 17 | /** 18 | * Echo exposes an expressive API for subscribing to channels and listening 19 | * for events that are broadcast by Laravel. Echo and event broadcasting 20 | * allows your team to easily build robust real-time web applications. 21 | */ 22 | 23 | // import Echo from 'laravel-echo'; 24 | 25 | // window.Pusher = require('pusher-js'); 26 | 27 | // window.Echo = new Echo({ 28 | // broadcaster: 'pusher', 29 | // key: process.env.MIX_PUSHER_APP_KEY, 30 | // cluster: process.env.MIX_PUSHER_APP_CLUSTER, 31 | // forceTLS: true 32 | // }); 33 | -------------------------------------------------------------------------------- /resources/views/roles/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Show Role

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 |
18 |
19 |
20 | Name: 21 | {{ $role->name }} 22 |
23 |
24 |
25 |
26 | Permissions: 27 | @if(!empty($rolePermissions)) 28 | @foreach($rolePermissions as $v) 29 | 30 | @endforeach 31 | @endif 32 |
33 |
34 |
35 | @endsection -------------------------------------------------------------------------------- /resources/views/products/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Show Product

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 |
18 |
19 |
20 | Name: 21 | {{ $product->name }} 22 |
23 |
24 |
25 |
26 | Details: 27 | {{ $product->detail }} 28 |
29 |
30 |
31 | @endsection 32 |

Tutorial by Codename-12

-------------------------------------------------------------------------------- /resources/views/jabatan/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Jabatan

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 |
18 |
19 |
20 | Nama Jabatan : 21 | {{ $jabatan->nama_jabatan }} 22 |
23 |
24 |
25 |
26 | Gaji : 27 | {{ $jabatan->gaji }} 28 |
29 |
30 |
31 | @endsection 32 |

Tutorial by Codename-12

-------------------------------------------------------------------------------- /app/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | > 16 | */ 17 | protected $listen = [ 18 | Registered::class => [ 19 | SendEmailVerificationNotification::class, 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | * 26 | * @return void 27 | */ 28 | public function boot() 29 | { 30 | // 31 | } 32 | 33 | /** 34 | * Determine if events and listeners should be automatically discovered. 35 | * 36 | * @return bool 37 | */ 38 | public function shouldDiscoverEvents() 39 | { 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | 'scheme' => 'https', 22 | ], 23 | 24 | 'postmark' => [ 25 | 'token' => env('POSTMARK_TOKEN'), 26 | ], 27 | 28 | 'ses' => [ 29 | 'key' => env('AWS_ACCESS_KEY_ID'), 30 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 31 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 32 | ], 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | LOG_DEPRECATIONS_CHANNEL=null 9 | LOG_LEVEL=debug 10 | 11 | DB_CONNECTION=mysql 12 | DB_HOST=127.0.0.1 13 | DB_PORT=3306 14 | DB_DATABASE=laravel 15 | DB_USERNAME=root 16 | DB_PASSWORD= 17 | 18 | BROADCAST_DRIVER=log 19 | CACHE_DRIVER=file 20 | FILESYSTEM_DISK=local 21 | QUEUE_CONNECTION=sync 22 | SESSION_DRIVER=file 23 | SESSION_LIFETIME=120 24 | 25 | MEMCACHED_HOST=127.0.0.1 26 | 27 | REDIS_HOST=127.0.0.1 28 | REDIS_PASSWORD=null 29 | REDIS_PORT=6379 30 | 31 | MAIL_MAILER=smtp 32 | MAIL_HOST=mailhog 33 | MAIL_PORT=1025 34 | MAIL_USERNAME=null 35 | MAIL_PASSWORD=null 36 | MAIL_ENCRYPTION=null 37 | MAIL_FROM_ADDRESS="hello@example.com" 38 | MAIL_FROM_NAME="${APP_NAME}" 39 | 40 | AWS_ACCESS_KEY_ID= 41 | AWS_SECRET_ACCESS_KEY= 42 | AWS_DEFAULT_REGION=us-east-1 43 | AWS_BUCKET= 44 | AWS_USE_PATH_STYLE_ENDPOINT=false 45 | 46 | PUSHER_APP_ID= 47 | PUSHER_APP_KEY= 48 | PUSHER_APP_SECRET= 49 | PUSHER_APP_CLUSTER=mt1 50 | 51 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 52 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 53 | -------------------------------------------------------------------------------- /app/Models/User.php: -------------------------------------------------------------------------------- 1 | 20 | */ 21 | protected $fillable = [ 22 | 'name', 23 | 'email', 24 | 'password', 25 | ]; 26 | 27 | /** 28 | * The attributes that should be hidden for serialization. 29 | * 30 | * @var array 31 | */ 32 | protected $hidden = [ 33 | 'password', 34 | 'remember_token', 35 | ]; 36 | 37 | /** 38 | * The attributes that should be cast. 39 | * 40 | * @var array 41 | */ 42 | protected $casts = [ 43 | 'email_verified_at' => 'datetime', 44 | ]; 45 | } 46 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest')->except('logout'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('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' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | 10 | */ 11 | class UserFactory extends Factory 12 | { 13 | /** 14 | * Define the model's default state. 15 | * 16 | * @return array 17 | */ 18 | public function definition() 19 | { 20 | return [ 21 | 'name' => $this->faker->name(), 22 | 'email' => $this->faker->unique()->safeEmail(), 23 | 'email_verified_at' => now(), 24 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 25 | 'remember_token' => Str::random(10), 26 | ]; 27 | } 28 | 29 | /** 30 | * Indicate that the model's email address should be unverified. 31 | * 32 | * @return static 33 | */ 34 | public function unverified() 35 | { 36 | return $this->state(function (array $attributes) { 37 | return [ 38 | 'email_verified_at' => null, 39 | ]; 40 | }); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /database/migrations/2023_02_06_151018_create_master_barang_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('kode_barang'); 19 | $table->string('nama_barang'); 20 | $table->double('harga_jual', 3,2); 21 | $table->double('harga_barang', 3,2); 22 | $table->string('qty'); 23 | $table->ForeignId('id_kategori')->constrained('kategori') 24 | ->onUpdate('cascade') 25 | ->onDelete('cascade'); 26 | $table->timestamps(); 27 | }); 28 | } 29 | 30 | /** 31 | * Reverse the migrations. 32 | * 33 | * @return void 34 | */ 35 | public function down() 36 | { 37 | Schema::dropIfExists('master_barang'); 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ConfirmPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | , \Psr\Log\LogLevel::*> 14 | */ 15 | protected $levels = [ 16 | // 17 | ]; 18 | 19 | /** 20 | * A list of the exception types that are not reported. 21 | * 22 | * @var array> 23 | */ 24 | protected $dontReport = [ 25 | // 26 | ]; 27 | 28 | /** 29 | * A list of the inputs that are never flashed for validation exceptions. 30 | * 31 | * @var array 32 | */ 33 | protected $dontFlash = [ 34 | 'current_password', 35 | 'password', 36 | 'password_confirmation', 37 | ]; 38 | 39 | /** 40 | * Register the exception handling callbacks for the application. 41 | * 42 | * @return void 43 | */ 44 | public function register() 45 | { 46 | $this->reportable(function (Throwable $e) { 47 | // 48 | }); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /database/migrations/2023_02_06_151609_create_penjualan_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->date('tgl_faktur'); 19 | $table->string('no_faktur'); 20 | $table->string('nama_konsumen'); 21 | $table->ForeignId('kode_barang')->constrained('master_barang') 22 | ->onUpdate('cascade') 23 | ->onDelete('cascade'); 24 | $table->string('jumlah'); 25 | $table->string('harga_satuan'); 26 | $table->string('harga_total'); 27 | $table->timestamps(); 28 | }); 29 | } 30 | 31 | /** 32 | * Reverse the migrations. 33 | * 34 | * @return void 35 | */ 36 | public function down() 37 | { 38 | Schema::dropIfExists('penjualan'); 39 | } 40 | }; 41 | -------------------------------------------------------------------------------- /resources/views/auth/verify.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Verify Your Email Address') }}
9 | 10 |
11 | @if (session('resent')) 12 | 15 | @endif 16 | 17 | {{ __('Before proceeding, please check your email for a verification link.') }} 18 | {{ __('If you did not receive the email') }}, 19 |
20 | @csrf 21 | . 22 |
23 |
24 |
25 |
26 |
27 |
28 | @endsection 29 | -------------------------------------------------------------------------------- /resources/views/users/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Show User

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 |
18 |
19 |
20 | Name: 21 | {{ $user->name }} 22 |
23 |
24 |
25 |
26 | Email: 27 | {{ $user->email }} 28 |
29 |
30 |
31 |
32 | Roles: 33 | @if(!empty($user->getRoleNames())) 34 | @foreach($user->getRoleNames() as $v) 35 | 36 | @endforeach 37 | @endif 38 |
39 |
40 |
41 | @endsection -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | ./tests/Unit 10 | 11 | 12 | ./tests/Feature 13 | 14 | 15 | 16 | 17 | ./app 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/VerificationController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 39 | $this->middleware('signed')->only('verify'); 40 | $this->middleware('throttle:6,1')->only('verify', 'resend'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /database/migrations/2023_02_06_143655_create_pegawai_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('nama', 100)->nullable()->default('text'); 19 | $table->date('tanggal_lahir'); 20 | $table->string('alamat'); 21 | $table->string('no_hp'); 22 | $table->ForeignId('id_user')->constrained('users') 23 | ->onUpdate('cascade') 24 | ->onDelete('cascade'); 25 | $table->ForeignId('id_jabatan')->constrained('jabatan') 26 | ->onUpdate('cascade') 27 | ->onDelete('cascade'); 28 | 29 | $table->timestamps(); 30 | }); 31 | } 32 | 33 | /** 34 | * Reverse the migrations. 35 | * 36 | * @return void 37 | */ 38 | public function down() 39 | { 40 | Schema::dropIfExists('pegawai'); 41 | } 42 | }; 43 | -------------------------------------------------------------------------------- /resources/views/pegawai/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Show Pegawai

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 |
18 |
19 |
20 | Nama : 21 | {{ $pegawai->nama }} 22 |
23 |
24 |
25 |
26 | Tanggal Lahir : 27 | {{ $pegawai->tanggal_lahir }} 28 |
29 |
30 |
31 |
32 | Alamat : 33 | {{ $pegawai->alamat }} 34 |
35 |
36 |
37 |
38 | Nomor HP: 39 | {{ $pegawai->no_hp }} 40 |
41 |
42 |
43 | @endsection 44 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | configureRateLimiting(); 30 | 31 | $this->routes(function () { 32 | Route::middleware('api') 33 | ->prefix('api') 34 | ->group(base_path('routes/api.php')); 35 | 36 | Route::middleware('web') 37 | ->group(base_path('routes/web.php')); 38 | }); 39 | } 40 | 41 | /** 42 | * Configure the rate limiters for the application. 43 | * 44 | * @return void 45 | */ 46 | protected function configureRateLimiting() 47 | { 48 | RateLimiter::for('api', function (Request $request) { 49 | return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()); 50 | }); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /resources/views/jabatan/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Products

9 |
10 |
11 | @can('product-create') 12 | Create New Product 13 | @endcan 14 |
15 |
16 |
17 | 18 | 19 | @if ($message = Session::get('success')) 20 |
21 |

{{ $message }}

22 |
23 | @endif 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
NoNama JabatanJumlah GajiAction
34 | 50 | @endsection -------------------------------------------------------------------------------- /resources/views/kategori/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Kategori

9 |
10 |
11 | @can('kategori-create') 12 | Buat Kategori Baru 13 | @endcan 14 |
15 |
16 |
17 | 18 | 19 | @if ($message = Session::get('success')) 20 |
21 |

{{ $message }}

22 |
23 | @endif 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
NoNama KategoriKeteranganAction
34 | 50 | @endsection -------------------------------------------------------------------------------- /resources/views/master_barang/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Show Kategori

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 |
18 |
19 |
20 | Kode Barang: 21 | {{ $master_barang->kode_barang }} 22 |
23 |
24 |
25 |
26 | Nama Barang : 27 | {{ $master_barang->nama_barang }} 28 |
29 |
30 |
31 |
32 | Harga Jual: 33 | {{ $master_barang->harga_jual }} 34 |
35 |
36 |
37 |
38 | Harga Barang: 39 | {{ $master_barang->harga_barang }} 40 |
41 |
42 |
43 |
44 | Quantity : 45 | {{ $master_barang->qty }} 46 |
47 |
48 |
49 | @endsection 50 | -------------------------------------------------------------------------------- /resources/views/roles/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Role Management

9 |
10 |
11 | @can('role-create') 12 | Create New Role 13 | @endcan 14 |
15 |
16 |
17 | 18 | 19 | @if ($message = Session::get('success')) 20 |
21 |

{{ $message }}

22 |
23 | @endif 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | @foreach ($roles as $key => $role) 33 | 34 | 35 | 36 | 47 | 48 | @endforeach 49 |
NoNameAction
{{ ++$i }}{{ $role->name }} 37 | Show 38 | @can('role-edit') 39 | Edit 40 | @endcan 41 | @can('role-delete') 42 | {!! Form::open(['method' => 'DELETE','route' => ['roles.destroy', $role->id],'style'=>'display:inline']) !!} 43 | {!! Form::submit('Delete', ['class' => 'btn btn-danger']) !!} 44 | {!! Form::close() !!} 45 | @endcan 46 |
50 | 51 | 52 | {!! $roles->render() !!} 53 | 54 | 55 |

Tutorial by Codename-12

56 | @endsection -------------------------------------------------------------------------------- /resources/views/jabatan/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Tambahkan Jabatan Baru

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 | @if ($errors->any()) 18 |
19 | Whoops! There were some problems with your input.

20 |
    21 | @foreach ($errors->all() as $error) 22 |
  • {{ $error }}
  • 23 | @endforeach 24 |
25 |
26 | @endif 27 | 28 | 29 |
30 | @csrf 31 | 32 | 33 |
34 |
35 |
36 | Nama Jabatan: 37 | 38 |
39 |
40 |
41 |
42 | Gaji : 43 | 44 |
45 |
46 |
47 | 48 |
49 |
50 | 51 | 52 |
53 | 54 | 55 | @endsection -------------------------------------------------------------------------------- /config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Bcrypt Options 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the configuration options that should be used when 26 | | passwords are hashed using the Bcrypt algorithm. This will allow you 27 | | to control the amount of time it takes to hash the given password. 28 | | 29 | */ 30 | 31 | 'bcrypt' => [ 32 | 'rounds' => env('BCRYPT_ROUNDS', 10), 33 | ], 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Argon Options 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here you may specify the configuration options that should be used when 41 | | passwords are hashed using the Argon algorithm. These will allow you 42 | | to control the amount of time it takes to hash the given password. 43 | | 44 | */ 45 | 46 | 'argon' => [ 47 | 'memory' => 65536, 48 | 'threads' => 1, 49 | 'time' => 4, 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | name('home'); 36 | 37 | Route::group(['middleware' => ['auth']], function() { 38 | Route::resource('roles', RoleController::class); 39 | Route::resource('users', UserController::class); 40 | Route::resource('products', ProductController::class); 41 | Route::resource('jabatan', Controller::class); 42 | Route::resource('kategori', UserController::class); 43 | Route::resource('master_barang', UserController::class); 44 | Route::resource('pegawai', UserController::class); 45 | Route::resource('penjualan', UserController::class); 46 | Route::resource('barang_masuk', UserController::class); 47 | }); -------------------------------------------------------------------------------- /resources/views/kategori/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Tambahkan Kategori Baru

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 | @if ($errors->any()) 18 |
19 | Whoops! There were some problems with your input.

20 |
    21 | @foreach ($errors->all() as $error) 22 |
  • {{ $error }}
  • 23 | @endforeach 24 |
25 |
26 | @endif 27 | 28 | 29 |
30 | @csrf 31 | 32 | 33 |
34 |
35 |
36 | Nama Kategori: 37 | 38 |
39 |
40 |
41 |
42 | keterangan : 43 | 44 |
45 |
46 |
47 | 48 |
49 |
50 | 51 | 52 |
53 | 54 | 55 | @endsection -------------------------------------------------------------------------------- /resources/views/users/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Users Management

9 |
10 |
11 | Create New User 12 |
13 |
14 |
15 | 16 | 17 | @if ($message = Session::get('success')) 18 |
19 |

{{ $message }}

20 |
21 | @endif 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | @foreach ($data as $key => $user) 33 | 34 | 35 | 36 | 37 | 44 | 51 | 52 | @endforeach 53 |
NoNameEmailRolesAction
{{ ++$i }}{{ $user->name }}{{ $user->email }} 38 | @if(!empty($user->getRoleNames())) 39 | @foreach($user->getRoleNames() as $v) 40 | 41 | @endforeach 42 | @endif 43 | 45 | Show 46 | Edit 47 | {!! Form::open(['method' => 'DELETE','route' => ['users.destroy', $user->id],'style'=>'display:inline']) !!} 48 | {!! Form::submit('Delete', ['class' => 'btn btn-danger']) !!} 49 | {!! Form::close() !!} 50 |
54 | 55 | 56 | {!! $data->render() !!} 57 | 58 |

Tutorial by Codename-12

59 | @endsection -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /resources/views/jabatan/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Edit Jabatan

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 | @if ($errors->any()) 18 |
19 | Whoops! There were some problems with your input.

20 |
    21 | @foreach ($errors->all() as $error) 22 |
  • {{ $error }}
  • 23 | @endforeach 24 |
25 |
26 | @endif 27 | 28 | 29 |
30 | @csrf 31 | @method('PUT') 32 | 33 | 34 |
35 |
36 |
37 | Nama Jabatan: 38 | 39 |
40 |
41 |
42 |
43 | Gaji : 44 | {{ $jabatan->detail }}> 45 |
46 |
47 |
48 | 49 |
50 |
51 | 52 | 53 |
54 | 55 | @endsection -------------------------------------------------------------------------------- /resources/views/kategori/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Edit kategori

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 | @if ($errors->any()) 18 |
19 | Whoops! There were some problems with your input.

20 |
    21 | @foreach ($errors->all() as $error) 22 |
  • {{ $error }}
  • 23 | @endforeach 24 |
25 |
26 | @endif 27 | 28 | 29 |
30 | @csrf 31 | @method('PUT') 32 | 33 | 34 |
35 |
36 |
37 | Nama kategori: 38 | 39 |
40 |
41 |
42 |
43 | keterangan : 44 | {{ $kategori->detail }}> 45 |
46 |
47 |
48 | 49 |
50 |
51 | 52 | 53 |
54 | 55 | @endsection -------------------------------------------------------------------------------- /resources/views/products/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Add New Product

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 | @if ($errors->any()) 18 |
19 | Whoops! There were some problems with your input.

20 |
    21 | @foreach ($errors->all() as $error) 22 |
  • {{ $error }}
  • 23 | @endforeach 24 |
25 |
26 | @endif 27 | 28 | 29 |
30 | @csrf 31 | 32 | 33 |
34 |
35 |
36 | Name: 37 | 38 |
39 |
40 |
41 |
42 | Detail: 43 | 44 |
45 |
46 |
47 | 48 |
49 |
50 | 51 | 52 |
53 | 54 | 55 |

Tutorial by Codename-12

56 | @endsection -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /resources/views/pegawai/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Pegawai

8 |
9 |
10 | @can('pegawai-create') 11 | Buat Data Pegawai Baru 12 | @endcan 13 |
14 |
15 |
16 | 17 | 18 | @if ($message = Session::get('success')) 19 |
20 |

{{ $message }}

21 |
22 | @endif 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
NoNamaTanggal LahirAlamatNomor HPAction
35 | @endsection 36 | 56 | @endsection -------------------------------------------------------------------------------- /resources/views/roles/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Create New Role

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 | @if (count($errors) > 0) 18 |
19 | Whoops! There were some problems with your input.

20 |
    21 | @foreach ($errors->all() as $error) 22 |
  • {{ $error }}
  • 23 | @endforeach 24 |
25 |
26 | @endif 27 | 28 | 29 | {!! Form::open(array('route' => 'roles.store','method'=>'POST')) !!} 30 |
31 |
32 |
33 | Name: 34 | {!! Form::text('name', null, array('placeholder' => 'Name','class' => 'form-control')) !!} 35 |
36 |
37 |
38 |
39 | Permission: 40 |
41 | @foreach($permission as $value) 42 | 44 |
45 | @endforeach 46 |
47 |
48 |
49 | 50 |
51 |
52 | {!! Form::close() !!} 53 | 54 | 55 |

Tutorial by Codename-12

56 | @endsection -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class); 50 | 51 | $response = $kernel->handle( 52 | $request = Request::capture() 53 | )->send(); 54 | 55 | $kernel->terminate($request, $response); 56 | -------------------------------------------------------------------------------- /resources/views/master_barang/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Kategori

8 |
9 |
10 | @can('kategori-create') 11 | Buat Kategori Baru 12 | @endcan 13 |
14 |
15 |
16 | 17 | 18 | @if ($message = Session::get('success')) 19 |
20 |

{{ $message }}

21 |
22 | @endif 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 |
NoKode BarangNama BarangHarga JualHarga BarangQuantityAction
36 | @endsection 37 | 57 | @endsection -------------------------------------------------------------------------------- /resources/views/products/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Edit Product

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 | @if ($errors->any()) 18 |
19 | Whoops! There were some problems with your input.

20 |
    21 | @foreach ($errors->all() as $error) 22 |
  • {{ $error }}
  • 23 | @endforeach 24 |
25 |
26 | @endif 27 | 28 | 29 |
30 | @csrf 31 | @method('PUT') 32 | 33 | 34 |
35 |
36 |
37 | Name: 38 | 39 |
40 |
41 |
42 |
43 | Detail: 44 | 45 |
46 |
47 |
48 | 49 |
50 |
51 | 52 | 53 |
54 | 55 | 56 |

Tutorial by Codename-12

57 | @endsection -------------------------------------------------------------------------------- /resources/views/roles/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Edit Role

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 | @if (count($errors) > 0) 18 |
19 | Whoops! There were some problems with your input.

20 |
    21 | @foreach ($errors->all() as $error) 22 |
  • {{ $error }}
  • 23 | @endforeach 24 |
25 |
26 | @endif 27 | 28 | 29 | {!! Form::model($role, ['method' => 'PATCH','route' => ['roles.update', $role->id]]) !!} 30 |
31 |
32 |
33 | Name: 34 | {!! Form::text('name', null, array('placeholder' => 'Name','class' => 'form-control')) !!} 35 |
36 |
37 |
38 |
39 | Permission: 40 |
41 | @foreach($permission as $value) 42 | 44 |
45 | @endforeach 46 |
47 |
48 |
49 | 50 |
51 |
52 | {!! Form::close() !!} 53 | 54 | 55 |

Tutorial by Codename-12

56 | @endsection -------------------------------------------------------------------------------- /resources/views/pegawai/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Edit Pegawai

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 | @if ($errors->any()) 18 |
19 | Whoops! There were some problems with your input.

20 |
    21 | @foreach ($errors->all() as $error) 22 |
  • {{ $error }}
  • 23 | @endforeach 24 |
25 |
26 | @endif 27 | 28 | 29 |
30 | @csrf 31 | @method('PUT') 32 | 33 | 34 |
35 |
36 | Nama : 37 | 38 |
39 |
40 |
41 | Alamat : 42 | 43 |
44 |
45 |
46 | Nomor HP : 47 | 48 |
49 |
50 |
51 | 52 |
53 |
54 | 55 | 56 | 57 | 58 | @endsection -------------------------------------------------------------------------------- /resources/views/products/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Products

9 |
10 |
11 | @can('product-create') 12 | Create New Product 13 | @endcan 14 |
15 |
16 |
17 | 18 | 19 | @if ($message = Session::get('success')) 20 |
21 |

{{ $message }}

22 |
23 | @endif 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | @foreach ($products as $product) 34 | 35 | 36 | 37 | 38 | 53 | 54 | @endforeach 55 |
NoNameDetailsAction
{{ ++$i }}{{ $product->name }}{{ $product->detail }} 39 |
40 | Show 41 | @can('product-edit') 42 | Edit 43 | @endcan 44 | 45 | 46 | @csrf 47 | @method('DELETE') 48 | @can('product-delete') 49 | 50 | @endcan 51 |
52 |
56 | 57 | 58 | {!! $products->links() !!} 59 | 60 | 61 |

Tutorial by Codename-12

62 | @endsection -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "type": "project", 4 | "description": "The Laravel Framework.", 5 | "keywords": ["framework", "laravel"], 6 | "license": "MIT", 7 | "require": { 8 | "php": "^8.0.2", 9 | "guzzlehttp/guzzle": "^7.2", 10 | "laravel/framework": "^9.2", 11 | "laravel/sanctum": "^2.14.1", 12 | "laravel/tinker": "^2.7", 13 | "laravel/ui": "^4.2", 14 | "laravelcollective/html": "^6.3", 15 | "spatie/laravel-permission": "^5.5" 16 | }, 17 | "require-dev": { 18 | "fakerphp/faker": "^1.9.1", 19 | "laravel/sail": "^1.0.1", 20 | "mockery/mockery": "^1.4.4", 21 | "nunomaduro/collision": "^6.1", 22 | "phpunit/phpunit": "^9.5.10", 23 | "spatie/laravel-ignition": "^1.0" 24 | }, 25 | "autoload": { 26 | "psr-4": { 27 | "App\\": "app/", 28 | "Database\\Factories\\": "database/factories/", 29 | "Database\\Seeders\\": "database/seeders/" 30 | } 31 | }, 32 | "autoload-dev": { 33 | "psr-4": { 34 | "Tests\\": "tests/" 35 | } 36 | }, 37 | "scripts": { 38 | "post-autoload-dump": [ 39 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 40 | "@php artisan package:discover --ansi" 41 | ], 42 | "post-update-cmd": [ 43 | "@php artisan vendor:publish --tag=laravel-assets --ansi --force" 44 | ], 45 | "post-root-package-install": [ 46 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 47 | ], 48 | "post-create-project-cmd": [ 49 | "@php artisan key:generate --ansi" 50 | ] 51 | }, 52 | "extra": { 53 | "laravel": { 54 | "dont-discover": [] 55 | } 56 | }, 57 | "config": { 58 | "optimize-autoloader": true, 59 | "preferred-install": "dist", 60 | "sort-packages": true 61 | }, 62 | "minimum-stability": "dev", 63 | "prefer-stable": true 64 | } 65 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/email.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Reset Password') }}
9 | 10 |
11 | @if (session('status')) 12 | 15 | @endif 16 | 17 |
18 | @csrf 19 | 20 |
21 | 22 | 23 |
24 | 25 | 26 | @error('email') 27 | 28 | {{ $message }} 29 | 30 | @enderror 31 |
32 |
33 | 34 |
35 |
36 | 39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | @endsection 48 | -------------------------------------------------------------------------------- /resources/views/penjualan/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Penjualan

8 |
9 |
10 | @can('penjualan-create') 11 | Buat Data Pegawai Baru 12 | @endcan 13 |
14 |
15 |
16 | 17 | 18 | @if ($message = Session::get('success')) 19 |
20 |

{{ $message }}

21 |
22 | @endif 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
NoTanggal FakturNo FakturNama KonsumenKode BarangJumlahHarga SatuanHarga TotalAction
38 | @endsection 39 | 60 | @endsection -------------------------------------------------------------------------------- /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_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'cluster' => env('PUSHER_APP_CLUSTER'), 40 | 'useTLS' => true, 41 | ], 42 | 'client_options' => [ 43 | // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html 44 | ], 45 | ], 46 | 47 | 'ably' => [ 48 | 'driver' => 'ably', 49 | 'key' => env('ABLY_KEY'), 50 | ], 51 | 52 | 'redis' => [ 53 | 'driver' => 'redis', 54 | 'connection' => 'default', 55 | ], 56 | 57 | 'log' => [ 58 | 'driver' => 'log', 59 | ], 60 | 61 | 'null' => [ 62 | 'driver' => 'null', 63 | ], 64 | 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /resources/views/penjualan/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Show Penjualan

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 |
18 |
19 |
20 | Tanggal Faktur : 21 | {{ $penjualan->tgl_faktur }} 22 |
23 |
24 |
25 |
26 | Nomor Faktur : 27 | {{ $penjualan->no_faktur }} 28 |
29 |
30 |
31 |
32 | Nama Konsumen : 33 | {{ $penjualan->nama_konsumen }} 34 |
35 |
36 |
37 |
38 | Kode Barang: 39 | {{ $master_barang->kode_barang }} 40 |
41 |
42 |
43 |
44 | Jumlah : 45 | {{ $penjualan->jumlah }} 46 |
47 |
48 |
49 |
50 | Harga Satuan: 51 | {{ $penjualan->harga_satuan }} 52 |
53 |
54 |
55 |
56 | Harga Total: 57 | {{ $penjualan->harga_total }} 58 |
59 |
60 |
61 | @endsection 62 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/confirm.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Confirm Password') }}
9 | 10 |
11 | {{ __('Please confirm your password before continuing.') }} 12 | 13 |
14 | @csrf 15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | @error('password') 23 | 24 | {{ $message }} 25 | 26 | @enderror 27 |
28 |
29 | 30 |
31 |
32 | 35 | 36 | @if (Route::has('password.request')) 37 | 38 | {{ __('Forgot Your Password?') }} 39 | 40 | @endif 41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | @endsection 50 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisterController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 42 | } 43 | 44 | /** 45 | * Get a validator for an incoming registration request. 46 | * 47 | * @param array $data 48 | * @return \Illuminate\Contracts\Validation\Validator 49 | */ 50 | protected function validator(array $data) 51 | { 52 | return Validator::make($data, [ 53 | 'name' => ['required', 'string', 'max:255'], 54 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 55 | 'password' => ['required', 'string', 'min:8', 'confirmed'], 56 | ]); 57 | } 58 | 59 | /** 60 | * Create a new user instance after a valid registration. 61 | * 62 | * @param array $data 63 | * @return \App\Models\User 64 | */ 65 | protected function create(array $data) 66 | { 67 | return User::create([ 68 | 'name' => $data['name'], 69 | 'email' => $data['email'], 70 | 'password' => Hash::make($data['password']), 71 | ]); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /resources/views/pegawai/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Tambahkan Pegawai Baru

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 | @if ($errors->any()) 18 |
19 | Whoops! There were some problems with your input.

20 |
    21 | @foreach ($errors->all() as $error) 22 |
  • {{ $error }}
  • 23 | @endforeach 24 |
25 |
26 | @endif 27 | 28 | 29 |
30 | @csrf 31 | 32 | 33 |
34 |
35 |
36 | Nama : 37 | 38 |
39 |
40 |
41 |
42 | Tanggal Lahir : 43 | 44 |
45 |
46 |
47 | Alamat : 48 | 49 |
50 |
51 |
52 | Nomor HP : 53 | 54 |
55 |
56 |
57 | 58 |
59 |
60 | 61 | 62 | 63 | 64 | 65 | @endsection -------------------------------------------------------------------------------- /resources/views/master_barang/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Edit Barang

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 | @if ($errors->any()) 18 |
19 | Whoops! There were some problems with your input.

20 |
    21 | @foreach ($errors->all() as $error) 22 |
  • {{ $error }}
  • 23 | @endforeach 24 |
25 |
26 | @endif 27 | 28 | 29 |
30 | @csrf 31 | @method('PUT') 32 | 33 | 34 |
35 |
36 | Nama Barang : 37 | 38 |
39 |
40 |
41 | Harga Jual : 42 | 43 |
44 |
45 |
46 | Harga Barang : 47 | 48 |
49 |
50 |
51 | Quantity : 52 | < 53 |
54 |
55 |
56 | 57 |
58 |
59 | 60 | 61 | 62 | 63 | @endsection -------------------------------------------------------------------------------- /config/sanctum.php: -------------------------------------------------------------------------------- 1 | explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf( 19 | '%s%s', 20 | 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1', 21 | Sanctum::currentApplicationUrlWithPort() 22 | ))), 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Sanctum Guards 27 | |-------------------------------------------------------------------------- 28 | | 29 | | This array contains the authentication guards that will be checked when 30 | | Sanctum is trying to authenticate a request. If none of these guards 31 | | are able to authenticate the request, Sanctum will use the bearer 32 | | token that's present on an incoming request for authentication. 33 | | 34 | */ 35 | 36 | 'guard' => ['web'], 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Expiration Minutes 41 | |-------------------------------------------------------------------------- 42 | | 43 | | This value controls the number of minutes until an issued token will be 44 | | considered expired. If this value is null, personal access tokens do 45 | | not expire. This won't tweak the lifetime of first-party sessions. 46 | | 47 | */ 48 | 49 | 'expiration' => null, 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | Sanctum Middleware 54 | |-------------------------------------------------------------------------- 55 | | 56 | | When authenticating your first-party SPA with Sanctum you may need to 57 | | customize some of the middleware Sanctum uses while processing the 58 | | request. You may change the middleware listed below as required. 59 | | 60 | */ 61 | 62 | 'middleware' => [ 63 | 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class, 64 | 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /resources/views/users/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Create New User

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 | @if (count($errors) > 0) 18 |
19 | Whoops! There were some problems with your input.

20 |
    21 | @foreach ($errors->all() as $error) 22 |
  • {{ $error }}
  • 23 | @endforeach 24 |
25 |
26 | @endif 27 | 28 | 29 | 30 | {!! Form::open(array('route' => 'users.store','method'=>'POST')) !!} 31 |
32 |
33 |
34 | Name: 35 | {!! Form::text('name', null, array('placeholder' => 'Name','class' => 'form-control')) !!} 36 |
37 |
38 |
39 |
40 | Email: 41 | {!! Form::text('email', null, array('placeholder' => 'Email','class' => 'form-control')) !!} 42 |
43 |
44 |
45 |
46 | Password: 47 | {!! Form::password('password', array('placeholder' => 'Password','class' => 'form-control')) !!} 48 |
49 |
50 |
51 |
52 | Confirm Password: 53 | {!! Form::password('confirm-password', array('placeholder' => 'Confirm Password','class' => 'form-control')) !!} 54 |
55 |
56 |
57 |
58 | Role: 59 | {!! Form::select('roles[]', $roles,[], array('class' => 'form-control','multiple')) !!} 60 |
61 |
62 |
63 | 64 |
65 |
66 | {!! Form::close() !!} 67 | 68 | 69 |

Tutorial by Codename-12

70 | @endsection -------------------------------------------------------------------------------- /resources/views/users/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Edit New User

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 | @if (count($errors) > 0) 18 |
19 | Whoops! There were some problems with your input.

20 |
    21 | @foreach ($errors->all() as $error) 22 |
  • {{ $error }}
  • 23 | @endforeach 24 |
25 |
26 | @endif 27 | 28 | 29 | {!! Form::model($user, ['method' => 'PATCH','route' => ['users.update', $user->id]]) !!} 30 |
31 |
32 |
33 | Name: 34 | {!! Form::text('name', null, array('placeholder' => 'Name','class' => 'form-control')) !!} 35 |
36 |
37 |
38 |
39 | Email: 40 | {!! Form::text('email', null, array('placeholder' => 'Email','class' => 'form-control')) !!} 41 |
42 |
43 |
44 |
45 | Password: 46 | {!! Form::password('password', array('placeholder' => 'Password','class' => 'form-control')) !!} 47 |
48 |
49 |
50 |
51 | Confirm Password: 52 | {!! Form::password('confirm-password', array('placeholder' => 'Confirm Password','class' => 'form-control')) !!} 53 |
54 |
55 |
56 |
57 | Role: 58 | {!! Form::select('roles[]', $roles,$userRole, array('class' => 'form-control','multiple')) !!} 59 |
60 |
61 |
62 | 63 |
64 |
65 | {!! Form::close() !!} 66 | 67 | 68 |

Tutorial by Codename-12

69 | @endsection -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DISK', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Filesystem Disks 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure as many filesystem "disks" as you wish, and you 24 | | may even configure multiple disks of the same driver. Defaults have 25 | | been set up for each driver as an example of the required values. 26 | | 27 | | Supported Drivers: "local", "ftp", "sftp", "s3" 28 | | 29 | */ 30 | 31 | 'disks' => [ 32 | 33 | 'local' => [ 34 | 'driver' => 'local', 35 | 'root' => storage_path('app'), 36 | 'throw' => false, 37 | ], 38 | 39 | 'public' => [ 40 | 'driver' => 'local', 41 | 'root' => storage_path('app/public'), 42 | 'url' => env('APP_URL').'/storage', 43 | 'visibility' => 'public', 44 | 'throw' => false, 45 | ], 46 | 47 | 's3' => [ 48 | 'driver' => 's3', 49 | 'key' => env('AWS_ACCESS_KEY_ID'), 50 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 51 | 'region' => env('AWS_DEFAULT_REGION'), 52 | 'bucket' => env('AWS_BUCKET'), 53 | 'url' => env('AWS_URL'), 54 | 'endpoint' => env('AWS_ENDPOINT'), 55 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), 56 | 'throw' => false, 57 | ], 58 | 59 | ], 60 | 61 | /* 62 | |-------------------------------------------------------------------------- 63 | | Symbolic Links 64 | |-------------------------------------------------------------------------- 65 | | 66 | | Here you may configure the symbolic links that will be created when the 67 | | `storage:link` Artisan command is executed. The array keys should be 68 | | the locations of the links and the values should be their targets. 69 | | 70 | */ 71 | 72 | 'links' => [ 73 | public_path('storage') => storage_path('app/public'), 74 | ], 75 | 76 | ]; 77 | -------------------------------------------------------------------------------- /resources/views/master_barang/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Tambahkan Barang Baru

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 | @if ($errors->any()) 18 |
19 | Whoops! There were some problems with your input.

20 |
    21 | @foreach ($errors->all() as $error) 22 |
  • {{ $error }}
  • 23 | @endforeach 24 |
25 |
26 | @endif 27 | 28 | 29 |
30 | @csrf 31 | 32 | 33 |
34 |
35 |
36 | Kode Barang : 37 | 38 |
39 |
40 |
41 |
42 | Nama Barang : 43 | 44 |
45 |
46 |
47 | Harga Jual : 48 | 49 |
50 |
51 |
52 | Harga Barang : 53 | < 54 |
55 |
56 |
57 | Quantity : 58 | 59 |
60 |
61 |
62 | 63 |
64 |
65 | 66 | 67 | 68 | 69 | 70 | @endsection -------------------------------------------------------------------------------- /resources/views/penjualan/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Tambahkan Penjualan Baru

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 | @if ($errors->any()) 18 |
19 | Whoops! There were some problems with your input.

20 |
    21 | @foreach ($errors->all() as $error) 22 |
  • {{ $error }}
  • 23 | @endforeach 24 |
25 |
26 | @endif 27 | 28 | 29 |
30 | @csrf 31 | 32 | 33 |
34 |
35 |
36 | Tanggal Faktur : 37 | 38 |
39 |
40 |
41 |
42 | Nama Konsumen : 43 | 44 |
45 |
46 |
47 | Nama Konsumen : 48 | 49 |
50 |
51 |
52 | Jumlah : 53 | 54 |
55 |
56 | Harga Satuan : 57 | 58 |
59 |
60 | Harga Total : 61 | 62 |
63 |
64 |
65 | 66 |
67 |
68 | 69 | 70 | 71 | 72 | 73 | @endsection -------------------------------------------------------------------------------- /resources/views/penjualan/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |

Edit Penjualan

9 |
10 |
11 | Back 12 |
13 |
14 |
15 | 16 | 17 | @if ($errors->any()) 18 |
19 | Whoops! There were some problems with your input.

20 |
    21 | @foreach ($errors->all() as $error) 22 |
  • {{ $error }}
  • 23 | @endforeach 24 |
25 |
26 | @endif 27 | 28 | 29 |
30 | @csrf 31 | @method('PUT') 32 | 33 | 34 |
35 |
36 | Tanggal Faktur : 37 | 38 |
39 |
40 |
41 | Nomor Faktur : 42 | 43 |
44 |
45 |
46 | Nama Konsumen : 47 | 48 |
49 |
50 |
51 |
52 | Jumlah : 53 | 54 |
55 |
56 |
57 | Harga Satuan : 58 | 59 |
60 |
61 |
62 |
63 | Harga Total : 64 | 65 |
66 |
67 |
68 | 69 |
70 |
71 | 72 | 73 | 74 | 75 | @endsection -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | protected $middleware = [ 17 | // \App\Http\Middleware\TrustHosts::class, 18 | \App\Http\Middleware\TrustProxies::class, 19 | \Illuminate\Http\Middleware\HandleCors::class, 20 | \App\Http\Middleware\PreventRequestsDuringMaintenance::class, 21 | \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, 22 | \App\Http\Middleware\TrimStrings::class, 23 | \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, 24 | ]; 25 | 26 | /** 27 | * The application's route middleware groups. 28 | * 29 | * @var array> 30 | */ 31 | protected $middlewareGroups = [ 32 | 'web' => [ 33 | \App\Http\Middleware\EncryptCookies::class, 34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 35 | \Illuminate\Session\Middleware\StartSession::class, 36 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 37 | \App\Http\Middleware\VerifyCsrfToken::class, 38 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 39 | ], 40 | 41 | 'api' => [ 42 | // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, 43 | 'throttle:api', 44 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 45 | ], 46 | ]; 47 | 48 | /** 49 | * The application's route middleware. 50 | * 51 | * These middleware may be assigned to groups or used individually. 52 | * 53 | * @var array 54 | */ 55 | protected $routeMiddleware = [ 56 | 'auth' => \App\Http\Middleware\Authenticate::class, 57 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 58 | 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class, 59 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 60 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 61 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 62 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 63 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 64 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 65 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 66 | 'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class, 67 | 'permission' => \Spatie\Permission\Middlewares\PermissionMiddleware::class, 68 | 'role_or_permission' => \Spatie\Permission\Middlewares\RoleOrPermissionMiddleware::class, 69 | ]; 70 | } 71 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/reset.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Reset Password') }}
9 | 10 |
11 |
12 | @csrf 13 | 14 | 15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | @error('email') 23 | 24 | {{ $message }} 25 | 26 | @enderror 27 |
28 |
29 | 30 |
31 | 32 | 33 |
34 | 35 | 36 | @error('password') 37 | 38 | {{ $message }} 39 | 40 | @enderror 41 |
42 |
43 | 44 |
45 | 46 | 47 |
48 | 49 |
50 |
51 | 52 |
53 |
54 | 57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | @endsection 66 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_CONNECTION', 'sync'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Queue Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure the connection information for each server that 24 | | is used by your application. A default configuration has been added 25 | | for each back-end shipped with Laravel. You are free to add more. 26 | | 27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | 'after_commit' => false, 43 | ], 44 | 45 | 'beanstalkd' => [ 46 | 'driver' => 'beanstalkd', 47 | 'host' => 'localhost', 48 | 'queue' => 'default', 49 | 'retry_after' => 90, 50 | 'block_for' => 0, 51 | 'after_commit' => false, 52 | ], 53 | 54 | 'sqs' => [ 55 | 'driver' => 'sqs', 56 | 'key' => env('AWS_ACCESS_KEY_ID'), 57 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 58 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 59 | 'queue' => env('SQS_QUEUE', 'default'), 60 | 'suffix' => env('SQS_SUFFIX'), 61 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 62 | 'after_commit' => false, 63 | ], 64 | 65 | 'redis' => [ 66 | 'driver' => 'redis', 67 | 'connection' => 'default', 68 | 'queue' => env('REDIS_QUEUE', 'default'), 69 | 'retry_after' => 90, 70 | 'block_for' => null, 71 | 'after_commit' => false, 72 | ], 73 | 74 | ], 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | Failed Queue Jobs 79 | |-------------------------------------------------------------------------- 80 | | 81 | | These options configure the behavior of failed queue job logging so you 82 | | can control which database and table are used to store the jobs that 83 | | have failed. You may change them to any database / table you wish. 84 | | 85 | */ 86 | 87 | 'failed' => [ 88 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), 89 | 'database' => env('DB_CONNECTION', 'mysql'), 90 | 'table' => 'failed_jobs', 91 | ], 92 | 93 | ]; 94 | -------------------------------------------------------------------------------- /resources/views/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Login') }}
9 | 10 |
11 |
12 | @csrf 13 | 14 |
15 | 16 | 17 |
18 | 19 | 20 | @error('email') 21 | 22 | {{ $message }} 23 | 24 | @enderror 25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 | 33 | 34 | @error('password') 35 | 36 | {{ $message }} 37 | 38 | @enderror 39 |
40 |
41 | 42 |
43 |
44 |
45 | 46 | 47 | 50 |
51 |
52 |
53 | 54 |
55 |
56 | 59 | 60 | @if (Route::has('password.request')) 61 | 62 | {{ __('Forgot Your Password?') }} 63 | 64 | @endif 65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 | @endsection 74 | -------------------------------------------------------------------------------- /app/Http/Controllers/ProductController.php: -------------------------------------------------------------------------------- 1 | middleware('permission:product-list|product-create|product-edit|product-delete', ['only' => ['index','show']]); 18 | $this->middleware('permission:product-create', ['only' => ['create','store']]); 19 | $this->middleware('permission:product-edit', ['only' => ['edit','update']]); 20 | $this->middleware('permission:product-delete', ['only' => ['destroy']]); 21 | } 22 | /** 23 | * Display a listing of the resource. 24 | * 25 | * @return \Illuminate\Http\Response 26 | */ 27 | public function index() 28 | { 29 | $products = Product::latest()->paginate(5); 30 | return view('products.index',compact('products')) 31 | ->with('i', (request()->input('page', 1) - 1) * 5); 32 | } 33 | 34 | /** 35 | * Show the form for creating a new resource. 36 | * 37 | * @return \Illuminate\Http\Response 38 | */ 39 | public function create() 40 | { 41 | return view('products.create'); 42 | } 43 | 44 | /** 45 | * Store a newly created resource in storage. 46 | * 47 | * @param \Illuminate\Http\Request $request 48 | * @return \Illuminate\Http\Response 49 | */ 50 | public function store(Request $request) 51 | { 52 | request()->validate([ 53 | 'name' => 'required', 54 | 'detail' => 'required', 55 | ]); 56 | 57 | Product::create($request->all()); 58 | 59 | return redirect()->route('products.index') 60 | ->with('success','Product created successfully.'); 61 | } 62 | 63 | /** 64 | * Display the specified resource. 65 | * 66 | * @param \App\Product $product 67 | * @return \Illuminate\Http\Response 68 | */ 69 | public function show(Product $product) 70 | { 71 | return view('products.show',compact('product')); 72 | } 73 | 74 | /** 75 | * Show the form for editing the specified resource. 76 | * 77 | * @param \App\Product $product 78 | * @return \Illuminate\Http\Response 79 | */ 80 | public function edit(Product $product) 81 | { 82 | return view('products.edit',compact('product')); 83 | } 84 | 85 | /** 86 | * Update the specified resource in storage. 87 | * 88 | * @param \Illuminate\Http\Request $request 89 | * @param \App\Product $product 90 | * @return \Illuminate\Http\Response 91 | */ 92 | public function update(Request $request, Product $product) 93 | { 94 | request()->validate([ 95 | 'name' => 'required', 96 | 'detail' => 'required', 97 | ]); 98 | 99 | $product->update($request->all()); 100 | 101 | return redirect()->route('products.index') 102 | ->with('success','Product updated successfully'); 103 | } 104 | 105 | /** 106 | * Remove the specified resource from storage. 107 | * 108 | * @param \App\Product $product 109 | * @return \Illuminate\Http\Response 110 | */ 111 | public function destroy(Product $product) 112 | { 113 | $product->delete(); 114 | 115 | return redirect()->route('products.index') 116 | ->with('success','Product deleted successfully'); 117 | } 118 | } -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Cache Stores 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the cache "stores" for your application as 26 | | well as their drivers. You may even define multiple stores for the 27 | | same cache driver to group types of items stored in your caches. 28 | | 29 | | Supported drivers: "apc", "array", "database", "file", 30 | | "memcached", "redis", "dynamodb", "octane", "null" 31 | | 32 | */ 33 | 34 | 'stores' => [ 35 | 36 | 'apc' => [ 37 | 'driver' => 'apc', 38 | ], 39 | 40 | 'array' => [ 41 | 'driver' => 'array', 42 | 'serialize' => false, 43 | ], 44 | 45 | 'database' => [ 46 | 'driver' => 'database', 47 | 'table' => 'cache', 48 | 'connection' => null, 49 | 'lock_connection' => null, 50 | ], 51 | 52 | 'file' => [ 53 | 'driver' => 'file', 54 | 'path' => storage_path('framework/cache/data'), 55 | ], 56 | 57 | 'memcached' => [ 58 | 'driver' => 'memcached', 59 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 60 | 'sasl' => [ 61 | env('MEMCACHED_USERNAME'), 62 | env('MEMCACHED_PASSWORD'), 63 | ], 64 | 'options' => [ 65 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 66 | ], 67 | 'servers' => [ 68 | [ 69 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 70 | 'port' => env('MEMCACHED_PORT', 11211), 71 | 'weight' => 100, 72 | ], 73 | ], 74 | ], 75 | 76 | 'redis' => [ 77 | 'driver' => 'redis', 78 | 'connection' => 'cache', 79 | 'lock_connection' => 'default', 80 | ], 81 | 82 | 'dynamodb' => [ 83 | 'driver' => 'dynamodb', 84 | 'key' => env('AWS_ACCESS_KEY_ID'), 85 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 86 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 87 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 88 | 'endpoint' => env('DYNAMODB_ENDPOINT'), 89 | ], 90 | 91 | 'octane' => [ 92 | 'driver' => 'octane', 93 | ], 94 | 95 | ], 96 | 97 | /* 98 | |-------------------------------------------------------------------------- 99 | | Cache Key Prefix 100 | |-------------------------------------------------------------------------- 101 | | 102 | | When utilizing the APC, database, memcached, Redis, or DynamoDB cache 103 | | stores there might be other applications using the same cache. For 104 | | that reason, you may prefix every cache key to avoid collisions. 105 | | 106 | */ 107 | 108 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'), 109 | 110 | ]; 111 | -------------------------------------------------------------------------------- /resources/views/layouts/default.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | {{ config('app.name', 'Laravel') }} 11 | 12 | 13 | 14 | 15 | 16 | 17 | @vite(['resources/sass/app.scss', 'resources/js/app.js']) 18 | 19 | 20 |
21 | 74 | 75 |
76 | @yield('content') 77 |
78 |
79 | 80 | 81 | -------------------------------------------------------------------------------- /resources/views/auth/register.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Register') }}
9 | 10 |
11 |
12 | @csrf 13 | 14 |
15 | 16 | 17 |
18 | 19 | 20 | @error('name') 21 | 22 | {{ $message }} 23 | 24 | @enderror 25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 | 33 | 34 | @error('email') 35 | 36 | {{ $message }} 37 | 38 | @enderror 39 |
40 |
41 | 42 |
43 | 44 | 45 |
46 | 47 | 48 | @error('password') 49 | 50 | {{ $message }} 51 | 52 | @enderror 53 |
54 |
55 | 56 |
57 | 58 | 59 |
60 | 61 |
62 |
63 | 64 |
65 |
66 | 69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 | @endsection 78 | -------------------------------------------------------------------------------- /app/Http/Controllers/fakturController.php: -------------------------------------------------------------------------------- 1 | middleware('permission:faktur-list|faktur-create|faktur-edit|faktur-delete', ['only' => ['index','show']]); 18 | $this->middleware('permission:faktur-create', ['only' => ['create','store']]); 19 | $this->middleware('permission:faktur-edit', ['only' => ['edit','update']]); 20 | $this->middleware('permission:faktur-delete', ['only' => ['destroy']]); 21 | } 22 | /** 23 | * Display a listing of the resource. 24 | * 25 | * @return \Illuminate\Http\Response 26 | */ 27 | public function index() 28 | { 29 | if ($request->ajax()){ 30 | $data = faktur::select('*'); 31 | return Datatables::of($data) 32 | ->addIndexColumn() 33 | ->addColumn('action', 'faktur.actions') 34 | ->rawColumns(['action']) 35 | ->make(true); 36 | } 37 | return view('faktur.index'); 38 | } 39 | 40 | /** 41 | * Show the form for creating a new resource. 42 | * 43 | * @return \Illuminate\Http\Response 44 | */ 45 | public function create() 46 | { 47 | return view('faktur.create'); 48 | } 49 | 50 | /** 51 | * Store a newly created resource in storage. 52 | * 53 | * @param \Illuminate\Http\Request $request 54 | * @return \Illuminate\Http\Response 55 | */ 56 | public function store(Request $request) 57 | { 58 | request()->validate([ 59 | 'nama_jabatan' => 'required', 60 | 'gaji' => 'required', 61 | ]); 62 | 63 | faktur::create($request->all()); 64 | 65 | return redirect()->route('faktur.index') 66 | ->with('success','faktur created successfully.'); 67 | } 68 | 69 | /** 70 | * Display the specified resource. 71 | * 72 | * @param \App\faktur $faktur 73 | * @return \Illuminate\Http\Response 74 | */ 75 | public function show(faktur $faktur) 76 | { 77 | return view('faktur.show',compact('faktur')); 78 | } 79 | 80 | /** 81 | * Show the form for editing the specified resource. 82 | * 83 | * @param \App\faktur $faktur 84 | * @return \Illuminate\Http\Response 85 | */ 86 | public function edit(faktur $faktur) 87 | { 88 | return view('faktur.edit',compact('faktur')); 89 | } 90 | 91 | /** 92 | * Update the specified resource in storage. 93 | * 94 | * @param \Illuminate\Http\Request $request 95 | * @param \App\faktur $faktur 96 | * @return \Illuminate\Http\Response 97 | */ 98 | public function update(Request $request, faktur $faktur) 99 | { 100 | request()->validate([ 101 | 'name' => 'required', 102 | 'detail' => 'required', 103 | ]); 104 | 105 | $faktur->update($request->all()); 106 | 107 | return redirect()->route('faktur.index') 108 | ->with('success','faktur updated successfully'); 109 | } 110 | 111 | /** 112 | * Remove the specified resource from storage. 113 | * 114 | * @param \App\faktur $faktur 115 | * @return \Illuminate\Http\Response 116 | */ 117 | public function destroy(faktur $faktur) 118 | { 119 | $faktur->delete(); 120 | 121 | return redirect()->route('faktur.index') 122 | ->with('success','faktur deleted successfully'); 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /app/Http/Controllers/JabatanController.php: -------------------------------------------------------------------------------- 1 | middleware('permission:jabatan-list|jabatan-create|jabatan-edit|jabatan-delete', ['only' => ['index','show']]); 18 | $this->middleware('permission:jabatan-create', ['only' => ['create','store']]); 19 | $this->middleware('permission:jabatan-edit', ['only' => ['edit','update']]); 20 | $this->middleware('permission:jabatan-delete', ['only' => ['destroy']]); 21 | } 22 | /** 23 | * Display a listing of the resource. 24 | * 25 | * @return \Illuminate\Http\Response 26 | */ 27 | public function index() 28 | { 29 | if ($request->ajax()){ 30 | $data = jabatan::select('*'); 31 | return Datatables::of($data) 32 | ->addIndexColumn() 33 | ->addColumn('action', 'jabatan.actions') 34 | ->rawColumns(['action']) 35 | ->make(true); 36 | } 37 | return view('jabatan.index'); 38 | } 39 | 40 | /** 41 | * Show the form for creating a new resource. 42 | * 43 | * @return \Illuminate\Http\Response 44 | */ 45 | public function create() 46 | { 47 | return view('jabatan.create'); 48 | } 49 | 50 | /** 51 | * Store a newly created resource in storage. 52 | * 53 | * @param \Illuminate\Http\Request $request 54 | * @return \Illuminate\Http\Response 55 | */ 56 | public function store(Request $request) 57 | { 58 | request()->validate([ 59 | 'nama_jabatan' => 'required', 60 | 'gaji' => 'required', 61 | ]); 62 | 63 | jabatan::create($request->all()); 64 | 65 | return redirect()->route('jabatan.index') 66 | ->with('success','jabatan created successfully.'); 67 | } 68 | 69 | /** 70 | * Display the specified resource. 71 | * 72 | * @param \App\jabatan $jabatan 73 | * @return \Illuminate\Http\Response 74 | */ 75 | public function show(jabatan $jabatan) 76 | { 77 | return view('jabatan.show',compact('jabatan')); 78 | } 79 | 80 | /** 81 | * Show the form for editing the specified resource. 82 | * 83 | * @param \App\jabatan $jabatan 84 | * @return \Illuminate\Http\Response 85 | */ 86 | public function edit(jabatan $jabatan) 87 | { 88 | return view('jabatan.edit',compact('jabatan')); 89 | } 90 | 91 | /** 92 | * Update the specified resource in storage. 93 | * 94 | * @param \Illuminate\Http\Request $request 95 | * @param \App\jabatan $jabatan 96 | * @return \Illuminate\Http\Response 97 | */ 98 | public function update(Request $request, jabatan $jabatan) 99 | { 100 | request()->validate([ 101 | 'name' => 'required', 102 | 'detail' => 'required', 103 | ]); 104 | 105 | $jabatan->update($request->all()); 106 | 107 | return redirect()->route('jabatan.index') 108 | ->with('success','jabatan updated successfully'); 109 | } 110 | 111 | /** 112 | * Remove the specified resource from storage. 113 | * 114 | * @param \App\jabatan $jabatan 115 | * @return \Illuminate\Http\Response 116 | */ 117 | public function destroy(jabatan $jabatan) 118 | { 119 | $jabatan->delete(); 120 | 121 | return redirect()->route('jabatan.index') 122 | ->with('success','jabatan deleted successfully'); 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_MAILER', 'smtp'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Mailer Configurations 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure all of the mailers used by your application plus 24 | | their respective settings. Several examples have been configured for 25 | | you and you are free to add your own as your application requires. 26 | | 27 | | Laravel supports a variety of mail "transport" drivers to be used while 28 | | sending an e-mail. You will specify which one you are using for your 29 | | mailers below. You are free to add additional mailers as required. 30 | | 31 | | Supported: "smtp", "sendmail", "mailgun", "ses", 32 | | "postmark", "log", "array", "failover" 33 | | 34 | */ 35 | 36 | 'mailers' => [ 37 | 'smtp' => [ 38 | 'transport' => 'smtp', 39 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 40 | 'port' => env('MAIL_PORT', 587), 41 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 42 | 'username' => env('MAIL_USERNAME'), 43 | 'password' => env('MAIL_PASSWORD'), 44 | 'timeout' => null, 45 | ], 46 | 47 | 'ses' => [ 48 | 'transport' => 'ses', 49 | ], 50 | 51 | 'mailgun' => [ 52 | 'transport' => 'mailgun', 53 | ], 54 | 55 | 'postmark' => [ 56 | 'transport' => 'postmark', 57 | ], 58 | 59 | 'sendmail' => [ 60 | 'transport' => 'sendmail', 61 | 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), 62 | ], 63 | 64 | 'log' => [ 65 | 'transport' => 'log', 66 | 'channel' => env('MAIL_LOG_CHANNEL'), 67 | ], 68 | 69 | 'array' => [ 70 | 'transport' => 'array', 71 | ], 72 | 73 | 'failover' => [ 74 | 'transport' => 'failover', 75 | 'mailers' => [ 76 | 'smtp', 77 | 'log', 78 | ], 79 | ], 80 | ], 81 | 82 | /* 83 | |-------------------------------------------------------------------------- 84 | | Global "From" Address 85 | |-------------------------------------------------------------------------- 86 | | 87 | | You may wish for all e-mails sent by your application to be sent from 88 | | the same address. Here, you may specify a name and address that is 89 | | used globally for all e-mails that are sent by your application. 90 | | 91 | */ 92 | 93 | 'from' => [ 94 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 95 | 'name' => env('MAIL_FROM_NAME', 'Example'), 96 | ], 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Markdown Mail Settings 101 | |-------------------------------------------------------------------------- 102 | | 103 | | If you are using Markdown based email rendering, you may configure your 104 | | theme and component paths here, allowing you to customize the design 105 | | of the emails. Or, you may simply stick with the Laravel defaults! 106 | | 107 | */ 108 | 109 | 'markdown' => [ 110 | 'theme' => 'default', 111 | 112 | 'paths' => [ 113 | resource_path('views/vendor/mail'), 114 | ], 115 | ], 116 | 117 | ]; 118 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => 'web', 18 | 'passwords' => 'users', 19 | ], 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Authentication Guards 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Next, you may define every authentication guard for your application. 27 | | Of course, a great default configuration has been defined for you 28 | | here which uses session storage and the Eloquent user provider. 29 | | 30 | | All authentication drivers have a user provider. This defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | mechanisms used by this application to persist your user's data. 33 | | 34 | | Supported: "session" 35 | | 36 | */ 37 | 38 | 'guards' => [ 39 | 'web' => [ 40 | 'driver' => 'session', 41 | 'provider' => 'users', 42 | ], 43 | ], 44 | 45 | /* 46 | |-------------------------------------------------------------------------- 47 | | User Providers 48 | |-------------------------------------------------------------------------- 49 | | 50 | | All authentication drivers have a user provider. This defines how the 51 | | users are actually retrieved out of your database or other storage 52 | | mechanisms used by this application to persist your user's data. 53 | | 54 | | If you have multiple user tables or models you may configure multiple 55 | | sources which represent each model / table. These sources may then 56 | | be assigned to any extra authentication guards you have defined. 57 | | 58 | | Supported: "database", "eloquent" 59 | | 60 | */ 61 | 62 | 'providers' => [ 63 | 'users' => [ 64 | 'driver' => 'eloquent', 65 | 'model' => App\Models\User::class, 66 | ], 67 | 68 | // 'users' => [ 69 | // 'driver' => 'database', 70 | // 'table' => 'users', 71 | // ], 72 | ], 73 | 74 | /* 75 | |-------------------------------------------------------------------------- 76 | | Resetting Passwords 77 | |-------------------------------------------------------------------------- 78 | | 79 | | You may specify multiple password reset configurations if you have more 80 | | than one user table or model in the application and you want to have 81 | | separate password reset settings based on the specific user types. 82 | | 83 | | The expire time is the number of minutes that each reset token will be 84 | | considered valid. This security feature keeps tokens short-lived so 85 | | they have less time to be guessed. You may change this as needed. 86 | | 87 | */ 88 | 89 | 'passwords' => [ 90 | 'users' => [ 91 | 'provider' => 'users', 92 | 'table' => 'password_resets', 93 | 'expire' => 60, 94 | 'throttle' => 60, 95 | ], 96 | ], 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Password Confirmation Timeout 101 | |-------------------------------------------------------------------------- 102 | | 103 | | Here you may define the amount of seconds before a password confirmation 104 | | times out and the user is prompted to re-enter their password via the 105 | | confirmation screen. By default, the timeout lasts for three hours. 106 | | 107 | */ 108 | 109 | 'password_timeout' => 10800, 110 | 111 | ]; 112 | -------------------------------------------------------------------------------- /app/Http/Controllers/PegawaiController.php: -------------------------------------------------------------------------------- 1 | middleware('permission:pegawai-list|pegawai-create|pegawai-edit|pegawai-delete', ['only' => ['index','show']]); 19 | $this->middleware('permission:pegawai-create', ['only' => ['create','store']]); 20 | $this->middleware('permission:pegawai-edit', ['only' => ['edit','update']]); 21 | $this->middleware('permission:pegawai-delete', ['only' => ['destroy']]); 22 | } 23 | /** 24 | * Display a listing of the resource. 25 | * 26 | * @return \Illuminate\Http\Response 27 | */ 28 | public function index() 29 | { 30 | if ($request->ajax()){ 31 | $data = pegawai::select('*')->with(['users', 'jabatan']); 32 | return Datatables::of($data) 33 | ->addIndexColumn() 34 | ->addColumn('action', 'pegawai.actions') 35 | ->rawColumns(['action']) 36 | ->make(true); 37 | } 38 | return view('pegawai.index'); 39 | } 40 | 41 | /** 42 | * Show the form for creating a new resource. 43 | * 44 | * @return \Illuminate\Http\Response 45 | */ 46 | public function create() 47 | { 48 | return view('pegawai.create'); 49 | } 50 | 51 | /** 52 | * Store a newly created resource in storage. 53 | * 54 | * @param \Illuminate\Http\Request $request 55 | * @return \Illuminate\Http\Response 56 | */ 57 | public function store(Request $request) 58 | { 59 | request()->validate([ 60 | 'nama' => 'required', 61 | 'tanggal_lahir' => 'required', 62 | 'alamat' => 'required', 63 | 'no_hp' => 'required', 64 | ]); 65 | 66 | pegawai::create($request->all()); 67 | 68 | return redirect()->route('pegawai.index') 69 | ->with('success','pegawai created successfully.'); 70 | } 71 | 72 | /** 73 | * Display the specified resource. 74 | * 75 | * @param \App\pegawai $pegawai 76 | * @return \Illuminate\Http\Response 77 | */ 78 | public function show(pegawai $pegawai) 79 | { 80 | return view('pegawai.show',compact('pegawai')); 81 | } 82 | 83 | /** 84 | * Show the form for editing the specified resource. 85 | * 86 | * @param \App\pegawai $pegawai 87 | * @return \Illuminate\Http\Response 88 | */ 89 | public function edit(pegawai $pegawai) 90 | { 91 | return view('pegawai.edit',compact('pegawai')); 92 | } 93 | 94 | /** 95 | * Update the specified resource in storage. 96 | * 97 | * @param \Illuminate\Http\Request $request 98 | * @param \App\pegawai $pegawai 99 | * @return \Illuminate\Http\Response 100 | */ 101 | public function update(Request $request, pegawai $pegawai) 102 | { 103 | request()->validate([ 104 | 'nama' => 'required', 105 | 'tanggal_lahir' => 'required', 106 | 'alamat' => 'required', 107 | 'no_hp' => 'required', 108 | ]); 109 | 110 | $pegawai->update($request->all()); 111 | 112 | return redirect()->route('pegawai.index') 113 | ->with('success','pegawai updated successfully'); 114 | } 115 | 116 | /** 117 | * Remove the specified resource from storage. 118 | * 119 | * @param \App\pegawai $pegawai 120 | * @return \Illuminate\Http\Response 121 | */ 122 | public function destroy(pegawai $pegawai) 123 | { 124 | $pegawai->delete(); 125 | 126 | return redirect()->route('pegawai.index') 127 | ->with('success','pegawai deleted successfully'); 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /config/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 21 | 22 | /* 23 | |-------------------------------------------------------------------------- 24 | | Deprecations Log Channel 25 | |-------------------------------------------------------------------------- 26 | | 27 | | This option controls the log channel that should be used to log warnings 28 | | regarding deprecated PHP and library features. This allows you to get 29 | | your application ready for upcoming major versions of dependencies. 30 | | 31 | */ 32 | 33 | 'deprecations' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Log Channels 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here you may configure the log channels for your application. Out of 41 | | the box, Laravel uses the Monolog PHP logging library. This gives 42 | | you a variety of powerful log handlers / formatters to utilize. 43 | | 44 | | Available Drivers: "single", "daily", "slack", "syslog", 45 | | "errorlog", "monolog", 46 | | "custom", "stack" 47 | | 48 | */ 49 | 50 | 'channels' => [ 51 | 'stack' => [ 52 | 'driver' => 'stack', 53 | 'channels' => ['single'], 54 | 'ignore_exceptions' => false, 55 | ], 56 | 57 | 'single' => [ 58 | 'driver' => 'single', 59 | 'path' => storage_path('logs/laravel.log'), 60 | 'level' => env('LOG_LEVEL', 'debug'), 61 | ], 62 | 63 | 'daily' => [ 64 | 'driver' => 'daily', 65 | 'path' => storage_path('logs/laravel.log'), 66 | 'level' => env('LOG_LEVEL', 'debug'), 67 | 'days' => 14, 68 | ], 69 | 70 | 'slack' => [ 71 | 'driver' => 'slack', 72 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 73 | 'username' => 'Laravel Log', 74 | 'emoji' => ':boom:', 75 | 'level' => env('LOG_LEVEL', 'critical'), 76 | ], 77 | 78 | 'papertrail' => [ 79 | 'driver' => 'monolog', 80 | 'level' => env('LOG_LEVEL', 'debug'), 81 | 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), 82 | 'handler_with' => [ 83 | 'host' => env('PAPERTRAIL_URL'), 84 | 'port' => env('PAPERTRAIL_PORT'), 85 | 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), 86 | ], 87 | ], 88 | 89 | 'stderr' => [ 90 | 'driver' => 'monolog', 91 | 'level' => env('LOG_LEVEL', 'debug'), 92 | 'handler' => StreamHandler::class, 93 | 'formatter' => env('LOG_STDERR_FORMATTER'), 94 | 'with' => [ 95 | 'stream' => 'php://stderr', 96 | ], 97 | ], 98 | 99 | 'syslog' => [ 100 | 'driver' => 'syslog', 101 | 'level' => env('LOG_LEVEL', 'debug'), 102 | ], 103 | 104 | 'errorlog' => [ 105 | 'driver' => 'errorlog', 106 | 'level' => env('LOG_LEVEL', 'debug'), 107 | ], 108 | 109 | 'null' => [ 110 | 'driver' => 'monolog', 111 | 'handler' => NullHandler::class, 112 | ], 113 | 114 | 'emergency' => [ 115 | 'path' => storage_path('logs/laravel.log'), 116 | ], 117 | ], 118 | 119 | ]; 120 | -------------------------------------------------------------------------------- /resources/views/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | {{ config('app.name', 'Laravel') }} 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 80 | 81 |
82 |
83 | @yield('content') 84 |
85 |
86 |
87 | 88 | 89 | -------------------------------------------------------------------------------- /app/Http/Controllers/PenjualanController.php: -------------------------------------------------------------------------------- 1 | middleware('permission:penjualan-list|penjualan-create|penjualan-edit|penjualan-delete', ['only' => ['index','show']]); 18 | $this->middleware('permission:penjualan-create', ['only' => ['create','store']]); 19 | $this->middleware('permission:penjualan-edit', ['only' => ['edit','update']]); 20 | $this->middleware('permission:penjualan-delete', ['only' => ['destroy']]); 21 | } 22 | /** 23 | * Display a listing of the resource. 24 | * 25 | * @return \Illuminate\Http\Response 26 | */ 27 | public function index() 28 | { 29 | if ($request->ajax()){ 30 | $data = penjualan::select('*')->with('master_barang'); 31 | return Datatables::of($data) 32 | ->addIndexColumn() 33 | ->addColumn('action', 'penjualan.actions') 34 | ->rawColumns(['action']) 35 | ->make(true); 36 | } 37 | return view('penjualan.index'); 38 | } 39 | 40 | /** 41 | * Show the form for creating a new resource. 42 | * 43 | * @return \Illuminate\Http\Response 44 | */ 45 | public function create() 46 | { 47 | return view('penjualan.create'); 48 | } 49 | 50 | /** 51 | * Store a newly created resource in storage. 52 | * 53 | * @param \Illuminate\Http\Request $request 54 | * @return \Illuminate\Http\Response 55 | */ 56 | public function store(Request $request) 57 | { 58 | request()->validate([ 59 | 'tgl_faktur'=>'required', 60 | 'no_faktur'=>'required', 61 | 'nama_konsumen'=>'required', 62 | 'kode_barang'=>'required', 63 | 'jumlah' =>'required', 64 | 'harga_satuan'=>'required', 65 | 'harga_total'=>'required', 66 | ]); 67 | 68 | penjualan::create($request->all()); 69 | 70 | return redirect()->route('penjualan.index') 71 | ->with('success','penjualan created successfully.'); 72 | } 73 | 74 | /** 75 | * Display the specified resource. 76 | * 77 | * @param \App\penjualan $penjualan 78 | * @return \Illuminate\Http\Response 79 | */ 80 | public function show(penjualan $penjualan) 81 | { 82 | return view('penjualan.show',compact('penjualan')); 83 | } 84 | 85 | /** 86 | * Show the form for editing the specified resource. 87 | * 88 | * @param \App\penjualan $penjualan 89 | * @return \Illuminate\Http\Response 90 | */ 91 | public function edit(penjualan $penjualan) 92 | { 93 | return view('penjualan.edit',compact('penjualan')); 94 | } 95 | 96 | /** 97 | * Update the specified resource in storage. 98 | * 99 | * @param \Illuminate\Http\Request $request 100 | * @param \App\penjualan $penjualan 101 | * @return \Illuminate\Http\Response 102 | */ 103 | public function update(Request $request, penjualan $penjualan) 104 | { 105 | request()->validate([ 106 | 'name' => 'required', 107 | 'detail' => 'required', 108 | ]); 109 | 110 | $penjualan->update($request->all()); 111 | 112 | return redirect()->route('penjualan.index') 113 | ->with('success','penjualan updated successfully'); 114 | } 115 | 116 | /** 117 | * Remove the specified resource from storage. 118 | * 119 | * @param \App\penjualan $penjualan 120 | * @return \Illuminate\Http\Response 121 | */ 122 | public function destroy(penjualan $penjualan) 123 | { 124 | $penjualan->delete(); 125 | 126 | return redirect()->route('penjualan.index') 127 | ->with('success','penjualan deleted successfully'); 128 | } 129 | } 130 | --------------------------------------------------------------------------------