├── .editorconfig
├── .env.example
├── .gitattributes
├── .gitignore
├── .styleci.yml
├── README.md
├── app
├── Console
│ └── Kernel.php
├── Exceptions
│ └── Handler.php
├── Exports
│ ├── CustomerExport.php
│ ├── ProductExport.php
│ └── UserExport.php
├── Http
│ ├── Controllers
│ │ ├── Auth
│ │ │ ├── ConfirmPasswordController.php
│ │ │ ├── ForgotPasswordController.php
│ │ │ ├── LoginController.php
│ │ │ ├── RegisterController.php
│ │ │ ├── ResetPasswordController.php
│ │ │ └── VerificationController.php
│ │ ├── Controller.php
│ │ ├── CustomerController.php
│ │ ├── HomeController.php
│ │ ├── InvoiceController.php
│ │ ├── InvoiceDetailController.php
│ │ ├── MemberController.php
│ │ ├── ProductController.php
│ │ ├── SettingController.php
│ │ └── UserController.php
│ ├── Kernel.php
│ └── Middleware
│ │ ├── Authenticate.php
│ │ ├── EncryptCookies.php
│ │ ├── PreventRequestsDuringMaintenance.php
│ │ ├── RedirectIfAuthenticated.php
│ │ ├── TrimStrings.php
│ │ ├── TrustHosts.php
│ │ ├── TrustProxies.php
│ │ └── VerifyCsrfToken.php
├── Models
│ ├── Customer.php
│ ├── Invoice.php
│ ├── InvoiceDetail.php
│ ├── Member.php
│ ├── Product.php
│ ├── Setting.php
│ └── User.php
├── Policies
│ ├── CustomerPolicy.php
│ ├── InvoiceDetailPolicy.php
│ ├── InvoicePolicy.php
│ ├── MemberPolicy.php
│ ├── ProductPolicy.php
│ └── SettingPolicy.php
└── Providers
│ ├── AppServiceProvider.php
│ ├── AuthServiceProvider.php
│ ├── BroadcastServiceProvider.php
│ ├── EventServiceProvider.php
│ └── RouteServiceProvider.php
├── artisan
├── bootstrap
├── app.php
└── cache
│ └── .gitignore
├── composer.json
├── composer.lock
├── config
├── app.php
├── auth.php
├── broadcasting.php
├── cache.php
├── cors.php
├── database.php
├── dompdf.php
├── filesystems.php
├── hashing.php
├── logging.php
├── mail.php
├── queue.php
├── sanctum.php
├── services.php
├── session.php
└── view.php
├── database
├── .gitignore
├── factories
│ ├── CustomerFactory.php
│ ├── InvoiceDetailFactory.php
│ ├── InvoiceFactory.php
│ ├── MemberFactory.php
│ ├── ProductFactory.php
│ ├── SettingFactory.php
│ └── UserFactory.php
├── migrations
│ ├── 2014_10_12_000000_create_users_table.php
│ ├── 2014_10_12_100000_create_password_resets_table.php
│ ├── 2019_08_19_000000_create_failed_jobs_table.php
│ ├── 2019_12_14_000001_create_personal_access_tokens_table.php
│ ├── 2021_11_16_113145_create_products_table.php
│ ├── 2021_11_16_113916_create_customers_table.php
│ ├── 2021_11_16_114001_create_invoices_table.php
│ ├── 2021_11_16_114020_create_invoice_details_table.php
│ ├── 2021_11_16_114144_create_members_table.php
│ └── 2021_11_17_172832_create_settings_table.php
└── seeders
│ ├── CustomerSeeder.php
│ ├── DatabaseSeeder.php
│ ├── InvoiceDetailSeeder.php
│ ├── InvoiceSeeder.php
│ ├── MemberSeeder.php
│ ├── ProductSeeder.php
│ └── SettingSeeder.php
├── package-lock.json
├── package.json
├── phpunit.xml
├── public
├── .htaccess
├── assets
│ ├── css
│ │ ├── AdminLTE.css
│ │ ├── bootstrap.css
│ │ ├── bootstrap.datetimepicker.css
│ │ ├── bootstrap.min.css
│ │ ├── custom.css
│ │ ├── datatable.bootstrap.css
│ │ ├── datatable.css
│ │ ├── font-awesome.min.css
│ │ ├── ionicons.min.css
│ │ ├── print.css
│ │ ├── skin-purple.css
│ │ └── styles.css
│ ├── fonts
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.svg
│ │ ├── glyphicons-halflings-regular.ttf
│ │ ├── glyphicons-halflings-regular.woff
│ │ └── glyphicons-halflings-regular.woff2
│ └── js
│ │ ├── app.js
│ │ ├── app.min.js
│ │ ├── bootstrap.datetime.js
│ │ ├── bootstrap.js
│ │ ├── bootstrap.min.js
│ │ ├── bootstrap.password.js
│ │ ├── datatable.js
│ │ ├── datatables.bootstrap.js
│ │ ├── jquery.min.js
│ │ ├── moment.js
│ │ ├── npm.js
│ │ └── scripts.js
├── css
│ └── app.css
├── favicon.ico
├── image
│ ├── empty.png
│ └── logo.png
├── index.php
├── js
│ └── app.js
├── mix-manifest.json
├── robots.txt
└── web.config
├── resources
├── css
│ └── app.css
├── js
│ ├── app.js
│ └── bootstrap.js
├── lang
│ └── en
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
├── sass
│ ├── _variables.scss
│ └── app.scss
└── views
│ ├── FlashMessage.blade.php
│ ├── admin
│ ├── create.blade.php
│ ├── edit.blade.php
│ ├── fields.blade.php
│ ├── index.blade.php
│ ├── modal.blade.php
│ ├── show.blade.php
│ ├── table.blade.php
│ └── tableContent.blade.php
│ ├── auth
│ ├── login.blade.php
│ ├── passwords
│ │ ├── confirm.blade.php
│ │ ├── email.blade.php
│ │ └── reset.blade.php
│ ├── register.blade.php
│ └── verify.blade.php
│ ├── customers
│ ├── create.blade.php
│ ├── edit.blade.php
│ ├── fields.blade.php
│ ├── index.blade.php
│ ├── modal.blade.php
│ ├── show.blade.php
│ ├── table.blade.php
│ └── tableContent.blade.php
│ ├── home.blade.php
│ ├── invoices
│ ├── create.blade.php
│ ├── edit.blade.php
│ ├── fields.blade.php
│ ├── filters.blade.php
│ ├── index.blade.php
│ ├── modals.blade.php
│ ├── notes.blade.php
│ ├── products.blade.php
│ ├── select_customer.blade.php
│ ├── show.blade.php
│ ├── table.blade.php
│ └── tableContent.blade.php
│ ├── layouts
│ ├── app.blade.php
│ ├── footer.blade.php
│ ├── header.blade.php
│ └── sidebar.blade.php
│ ├── pdf
│ ├── customers.blade.php
│ ├── index.blade.php
│ ├── products.blade.php
│ └── users.blade.php
│ ├── products
│ ├── create.blade.php
│ ├── edit.blade.php
│ ├── fields.blade.php
│ ├── index.blade.php
│ ├── modal.blade.php
│ ├── show.blade.php
│ ├── table.blade.php
│ └── tableContent.blade.php
│ ├── settings
│ ├── fields.blade.php
│ └── index.blade.php
│ └── welcome.blade.php
├── routes
├── api.php
├── channels.php
├── console.php
└── web.php
├── server.php
├── storage
├── app
│ ├── .gitignore
│ └── public
│ │ └── .gitignore
├── framework
│ ├── .gitignore
│ ├── cache
│ │ ├── .gitignore
│ │ └── data
│ │ │ └── .gitignore
│ ├── sessions
│ │ └── .gitignore
│ ├── testing
│ │ └── .gitignore
│ └── views
│ │ └── .gitignore
└── logs
│ └── .gitignore
├── tests
├── CreatesApplication.php
├── Feature
│ └── ExampleTest.php
├── TestCase.php
└── Unit
│ └── ExampleTest.php
└── webpack.mix.js
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | end_of_line = lf
6 | insert_final_newline = true
7 | indent_style = space
8 | indent_size = 4
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
13 |
14 | [*.{yml,yaml}]
15 | indent_size = 2
16 |
17 | [docker-compose.yml]
18 | indent_size = 4
19 |
--------------------------------------------------------------------------------
/.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_invoice_management
15 | DB_USERNAME=root
16 | DB_PASSWORD=
17 |
18 | BROADCAST_DRIVER=log
19 | CACHE_DRIVER=file
20 | FILESYSTEM_DRIVER=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=null
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 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 | *.css linguist-vendored
3 | *.scss linguist-vendored
4 | *.js linguist-vendored
5 | CHANGELOG.md export-ignore
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /public/hot
3 | /public/storage
4 | /storage/*.key
5 | /vendor
6 | .env
7 | .env.backup
8 | .phpunit.result.cache
9 | docker-compose.override.yml
10 | Homestead.json
11 | Homestead.yaml
12 | npm-debug.log
13 | yarn-error.log
14 | /.idea
15 | /.vscode
16 |
--------------------------------------------------------------------------------
/.styleci.yml:
--------------------------------------------------------------------------------
1 | php:
2 | preset: laravel
3 | version: 8
4 | disabled:
5 | - no_unused_imports
6 | finder:
7 | not-name:
8 | - index.php
9 | - server.php
10 | js:
11 | finder:
12 | not-name:
13 | - webpack.mix.js
14 | css: true
15 |
--------------------------------------------------------------------------------
/app/Console/Kernel.php:
--------------------------------------------------------------------------------
1 | command('inspire')->hourly();
28 | }
29 |
30 | /**
31 | * Register the commands for the application.
32 | *
33 | * @return void
34 | */
35 | protected function commands()
36 | {
37 | $this->load(__DIR__.'/Commands');
38 |
39 | require base_path('routes/console.php');
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/Exceptions/Handler.php:
--------------------------------------------------------------------------------
1 | reportable(function (Throwable $e) {
38 | //
39 | });
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/Exports/CustomerExport.php:
--------------------------------------------------------------------------------
1 | middleware('auth');
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/ForgotPasswordController.php:
--------------------------------------------------------------------------------
1 | middleware('guest')->except('logout');
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/ResetPasswordController.php:
--------------------------------------------------------------------------------
1 | middleware('auth');
39 | $this->middleware('signed')->only('verify');
40 | $this->middleware('throttle:6,1')->only('verify', 'resend');
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Controller.php:
--------------------------------------------------------------------------------
1 | setting = Setting::first();
19 | }
20 |
21 |
22 | public function index(Request $request)
23 | {
24 | if ($request->ajax()) {
25 | return response()->json(['view' =>view('customers.tableContent', ['customers' => Customer::get()])->render()]);
26 | }
27 |
28 | if ($request->pdf) {
29 | $pdf = PDF::loadView('pdf.customers', ['customers' => Customer::get(), 'setting' => $this->setting]);
30 | return $pdf->download('customers_list.pdf');
31 | }
32 | return view('customers.index', ['customers' => Customer::get()]);
33 | }
34 |
35 |
36 | public function create()
37 | {
38 | return view('customers.create');
39 | }
40 |
41 |
42 | public function store(Request $request)
43 | {
44 | // dd($request->all());
45 | Customer::updateOrCreate(['id' => $request->customer_id], [
46 | 'name' => $request->name,
47 | 'email' => $request->email,
48 | 'phone' => $request->phone,
49 | 'address_1' => $request->address_1,
50 | 'city' => $request->city,
51 | 'post_code' => $request->postcode,
52 | 'address_2' => $request->address_2,
53 | 'country' => $request->country,
54 |
55 | 'ship_name' => $request->ship_name,
56 | 'ship_email' => $request->ship_email,
57 | 'ship_phone' => $request->ship_phone,
58 | 'ship_address_1' => $request->ship_address_1,
59 | 'ship_city' => $request->ship_city,
60 | 'ship_post_code' => $request->ship_postcode,
61 | 'ship_address_2' => $request->ship_address_2,
62 | 'ship_country' => $request->ship_country,
63 |
64 | ]);
65 |
66 | if ($request->ajax()) {
67 | return response()->json(['success' => $request->customer_id ? 'Customer Updated successfully' : 'Customer Created successfully', 'status' => 'Status 200 ']);
68 | }else {
69 | return redirect()->route('customers.index')->with('success', $request->customer_id ? 'Customer Updated successfully' : 'Customer Created successfully');
70 | }
71 |
72 | }
73 |
74 |
75 | public function edit(Customer $customer)
76 | {
77 | return view('customers.edit', ['customer' => $customer]);
78 | }
79 |
80 |
81 | public function show(Customer $customer)
82 | {
83 | $pdf = PDF::loadView('pdf.customers', ['customer' => $customer, 'setting' => $this->setting]);
84 | return $pdf->download('invoice.pdf');
85 | }
86 |
87 |
88 | public function destroy(Customer $customer, Request $request)
89 | {
90 | if (!Hash::check($request->password, auth()->user()->password)) {
91 | return response()->json(['not_valid' => 'Password not valid']);
92 | }
93 | try {
94 | $customer->delete();
95 | return response()->json(['success' => 'Customer Deleted Successfully']);
96 | } catch (\Throwable $th) {
97 | return response()->json(['error' => 'Customer Not Deleted Fail']);
98 | }
99 | }
100 |
101 | public function export()
102 | {
103 | try {
104 | return Excel::download(new CustomerExport, 'customers_list.xlsx');
105 | } catch (\Throwable $th) {
106 | return redirect()->back()->with('error', $th->getMessage());
107 | }
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/app/Http/Controllers/HomeController.php:
--------------------------------------------------------------------------------
1 | Product::count(),
18 | 'totalUsers' => User::count(),
19 | 'totalCustomers' => Customer::count(),
20 | 'totalInvoices' => Invoice::count(),
21 | 'totalPaidBill' => Invoice::where('status', 'paid')->count(),
22 | 'totalPendingBill' => Invoice::where('status', 'open')->count(),
23 | 'totalDueBill' => Invoice::whereDate('invoice_due_date', '<', now())->count(),
24 | 'totalAmount' => Invoice::sum('subtotal')]
25 | );
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Http/Controllers/InvoiceDetailController.php:
--------------------------------------------------------------------------------
1 | setting = Setting::first();
20 | }
21 |
22 | public function index(Request $request)
23 | {
24 | if ($request->ajax()) {
25 | return response()->json(['view' =>view('products.tableContent', ['products' => Product::get()])->render()]);
26 | }
27 |
28 | if ($request->pdf) {
29 | $pdf = PDF::loadView('pdf.products', ['products' => Product::get(), 'setting' => $this->setting]);
30 | return $pdf->download('products_list.pdf');
31 | }
32 |
33 | return view('products.index', ['products' => Product::get(), 'setting' => $this->setting]);
34 | }
35 |
36 |
37 | public function create()
38 | {
39 | return view('products.create');
40 | }
41 |
42 |
43 | public function store(Request $request)
44 | {
45 | Product::updateOrCreate(['id' => $request->product_id], [
46 | 'product_name' => $request->product_name,
47 | 'product_qty' => $request->product_qty,
48 | 'product_price' => $request->product_price,
49 | 'product_desc' => $request->product_desc,
50 | ]);
51 |
52 | if ($request->ajax()) {
53 | return response()->json(['success' => $request->product_id ? 'Product Updated successfully' : 'Product Created successfully', 'status' => 'Status 200 ']);
54 | }else {
55 | return redirect()->route('products.index')->with('success', $request->product_id ? 'Product Updated successfully' : 'Product Created successfully');
56 | }
57 | }
58 |
59 |
60 | public function edit(Product $product)
61 | {
62 | return view('products.edit', ['product' => $product, 'setting' => $this->setting]);
63 | }
64 |
65 | public function destroy(Product $product, Request $request)
66 | {
67 | if (!Hash::check($request->password, auth()->user()->password)) {
68 | return response()->json(['not_valid' => 'Password not valid']);
69 | }
70 | try {
71 | $product->delete();
72 | return response()->json(['success' => 'Product Deleted Successfully']);
73 | } catch (\Throwable $th) {
74 | return response()->json(['error' => 'Product Not Deleted Fail']);
75 | }
76 | }
77 |
78 |
79 | public function export()
80 | {
81 | try {
82 | return Excel::download(new ProductExport, 'products_list.xlsx');
83 | } catch (\Throwable $th) {
84 | return redirect()->back()->with('error', $th->getMessage());
85 | }
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/app/Http/Controllers/SettingController.php:
--------------------------------------------------------------------------------
1 | Setting::first()]);
14 | }
15 |
16 | public function store(Request $request)
17 | {
18 | Setting::updateOrCreate(['id' => $request->setting_id],
19 | $request->except('setting_id')
20 | );
21 |
22 | return redirect()->route('setting.index')->with('success', 'Setting Created or Updated Successfully');
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/Http/Controllers/UserController.php:
--------------------------------------------------------------------------------
1 | setting = Setting::first();
21 | }
22 |
23 |
24 | public function index(Request $request)
25 | {
26 | if ($request->ajax()) {
27 | return response()->json(['view' =>view('admin.tableContent', ['users' => User::get()])->render()]);
28 | }
29 |
30 | if ($request->pdf) {
31 | $pdf = PDF::loadView('pdf.users', ['users' => User::get(), 'setting' => $this->setting]);
32 | return $pdf->download('users_list.pdf');
33 | }
34 |
35 | return view('admin.index', ['users' => User::get()]);
36 | }
37 |
38 | public function create()
39 | {
40 | return view('admin.create');
41 | }
42 |
43 |
44 | public function store(Request $request)
45 | {
46 | User::updateOrCreate(['id' => $request->user_id], [
47 | 'name' => $request->name,
48 | 'email' => $request->email,
49 | 'phone' => $request->phone,
50 | 'username' => $request->username,
51 | 'password' => $request->password,
52 | ]);
53 |
54 | if ($request->ajax()) {
55 | return response()->json(['success' => $request->user_id ? 'User Updated successfully' : 'User Created successfully', 'status' => 'Status 200 ']);
56 | }else {
57 | return redirect()->route('user.index')->with('success', $request->user_id ? 'User Updated successfully' : 'User Created successfully');
58 | }
59 | }
60 |
61 | public function edit(User $user)
62 | {
63 | return view('admin.edit', ['user' => $user]);
64 | }
65 |
66 | public function destroy(User $user, Request $request)
67 | {
68 | if (!Hash::check($request->password, auth()->user()->password)) {
69 | return response()->json(['not_valid' => 'Password not valid']);
70 | }
71 | try {
72 | $user->delete();
73 | return response()->json(['success' => 'User Deleted Successfully']);
74 | } catch (\Throwable $th) {
75 | return response()->json(['error' => 'User Not Deleted Fail']);
76 | }
77 | }
78 |
79 | public function export()
80 | {
81 | try {
82 | return Excel::download(new UserExport, 'users_list.xlsx');
83 | } catch (\Throwable $th) {
84 | return redirect()->back()->with('error', $th->getMessage());
85 | }
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/app/Http/Kernel.php:
--------------------------------------------------------------------------------
1 | [
33 | \App\Http\Middleware\EncryptCookies::class,
34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
35 | \Illuminate\Session\Middleware\StartSession::class,
36 | // \Illuminate\Session\Middleware\AuthenticateSession::class,
37 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
38 | \App\Http\Middleware\VerifyCsrfToken::class,
39 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
40 | ],
41 |
42 | 'api' => [
43 | // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
44 | 'throttle:api',
45 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
46 | ],
47 | ];
48 |
49 | /**
50 | * The application's route middleware.
51 | *
52 | * These middleware may be assigned to groups or used individually.
53 | *
54 | * @var array
55 | */
56 | protected $routeMiddleware = [
57 | 'auth' => \App\Http\Middleware\Authenticate::class,
58 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::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 | ];
67 | }
68 |
--------------------------------------------------------------------------------
/app/Http/Middleware/Authenticate.php:
--------------------------------------------------------------------------------
1 | expectsJson()) {
18 | return route('login');
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/Http/Middleware/EncryptCookies.php:
--------------------------------------------------------------------------------
1 | check()) {
26 | return redirect(RouteServiceProvider::HOME);
27 | }
28 | }
29 |
30 | return $next($request);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrimStrings.php:
--------------------------------------------------------------------------------
1 | allSubdomainsOfApplicationUrl(),
18 | ];
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrustProxies.php:
--------------------------------------------------------------------------------
1 | 'datetime',
30 | 'invoice_due_date'=> 'datetime',
31 | ];
32 |
33 | /**
34 | * Get the user that owns the Invoice
35 | *
36 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
37 | */
38 | public function customer(): BelongsTo
39 | {
40 | return $this->belongsTo(Customer::class, 'email', 'email');
41 | }
42 |
43 | /**
44 | * Get all of the comments for the Invoice
45 | *
46 | * @return \Illuminate\Database\Eloquent\Relations\HasMany
47 | */
48 | public function invoiceDetails(): HasMany
49 | {
50 | return $this->hasMany(InvoiceDetail::class, 'invoice_id', 'id');
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/app/Models/InvoiceDetail.php:
--------------------------------------------------------------------------------
1 | belongsTo(Product::class, 'product_id', 'id');
31 | }
32 |
33 | public function products(): HasMany
34 | {
35 | return $this->hasMany(Product::class, 'product_id', 'id');
36 | }
37 |
38 | /**
39 | * Get the user that owns the InvoiceDetail
40 | *
41 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
42 | */
43 | public function invoice(): BelongsTo
44 | {
45 | return $this->belongsTo(Invoice::class, 'invoice_id', 'id');
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/app/Models/Member.php:
--------------------------------------------------------------------------------
1 | 'datetime',
45 | ];
46 | }
47 |
--------------------------------------------------------------------------------
/app/Policies/CustomerPolicy.php:
--------------------------------------------------------------------------------
1 | 'App\Policies\ModelPolicy',
17 | ];
18 |
19 | /**
20 | * Register any authentication / authorization services.
21 | *
22 | * @return void
23 | */
24 | public function boot()
25 | {
26 | $this->registerPolicies();
27 |
28 | //
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/Providers/BroadcastServiceProvider.php:
--------------------------------------------------------------------------------
1 | [
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 |
--------------------------------------------------------------------------------
/app/Providers/RouteServiceProvider.php:
--------------------------------------------------------------------------------
1 | configureRateLimiting();
39 |
40 | $this->routes(function () {
41 | Route::prefix('api')
42 | ->middleware('api')
43 | ->namespace($this->namespace)
44 | ->group(base_path('routes/api.php'));
45 |
46 | Route::middleware('web')
47 | ->namespace($this->namespace)
48 | ->group(base_path('routes/web.php'));
49 | });
50 | }
51 |
52 | /**
53 | * Configure the rate limiters for the application.
54 | *
55 | * @return void
56 | */
57 | protected function configureRateLimiting()
58 | {
59 | RateLimiter::for('api', function (Request $request) {
60 | return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
61 | });
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/bootstrap/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/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": "^7.3|^8.0",
9 | "barryvdh/laravel-dompdf": "^0.9.0",
10 | "fruitcake/laravel-cors": "^2.0",
11 | "guzzlehttp/guzzle": "^7.0.1",
12 | "laravel/framework": "^8.65",
13 | "laravel/sanctum": "^2.11",
14 | "laravel/tinker": "^2.5",
15 | "laravel/ui": "^3.3",
16 | "maatwebsite/excel": "^3.1"
17 | },
18 | "require-dev": {
19 | "facade/ignition": "^2.5",
20 | "fakerphp/faker": "^1.9.1",
21 | "laravel/sail": "^1.0.1",
22 | "mockery/mockery": "^1.4.4",
23 | "nunomaduro/collision": "^5.10",
24 | "phpunit/phpunit": "^9.5.10"
25 | },
26 | "autoload": {
27 | "psr-4": {
28 | "App\\": "app/",
29 | "Database\\Factories\\": "database/factories/",
30 | "Database\\Seeders\\": "database/seeders/"
31 | }
32 | },
33 | "autoload-dev": {
34 | "psr-4": {
35 | "Tests\\": "tests/"
36 | }
37 | },
38 | "scripts": {
39 | "post-autoload-dump": [
40 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
41 | "@php artisan package:discover --ansi"
42 | ],
43 | "post-update-cmd": [
44 | "@php artisan vendor:publish --tag=laravel-assets --ansi"
45 | ],
46 | "post-root-package-install": [
47 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
48 | ],
49 | "post-create-project-cmd": [
50 | "@php artisan key:generate --ansi"
51 | ]
52 | },
53 | "extra": {
54 | "laravel": {
55 | "dont-discover": []
56 | }
57 | },
58 | "config": {
59 | "optimize-autoloader": true,
60 | "preferred-install": "dist",
61 | "sort-packages": true
62 | },
63 | "minimum-stability": "dev",
64 | "prefer-stable": true
65 | }
66 |
--------------------------------------------------------------------------------
/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 the reset token should 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 |
--------------------------------------------------------------------------------
/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 | ],
43 |
44 | 'ably' => [
45 | 'driver' => 'ably',
46 | 'key' => env('ABLY_KEY'),
47 | ],
48 |
49 | 'redis' => [
50 | 'driver' => 'redis',
51 | 'connection' => 'default',
52 | ],
53 |
54 | 'log' => [
55 | 'driver' => 'log',
56 | ],
57 |
58 | 'null' => [
59 | 'driver' => 'null',
60 | ],
61 |
62 | ],
63 |
64 | ];
65 |
--------------------------------------------------------------------------------
/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 a RAM based store such as APC or Memcached, there might
103 | | be other applications utilizing the same cache. So, we'll specify a
104 | | value to get prefixed to all our keys so we can avoid collisions.
105 | |
106 | */
107 |
108 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
109 |
110 | ];
111 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/config/filesystems.php:
--------------------------------------------------------------------------------
1 | env('FILESYSTEM_DRIVER', '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 setup for each driver as an example of the required options.
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 | ],
37 |
38 | 'public' => [
39 | 'driver' => 'local',
40 | 'root' => storage_path('app/public'),
41 | 'url' => env('APP_URL').'/storage',
42 | 'visibility' => 'public',
43 | ],
44 |
45 | 's3' => [
46 | 'driver' => 's3',
47 | 'key' => env('AWS_ACCESS_KEY_ID'),
48 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
49 | 'region' => env('AWS_DEFAULT_REGION'),
50 | 'bucket' => env('AWS_BUCKET'),
51 | 'url' => env('AWS_URL'),
52 | 'endpoint' => env('AWS_ENDPOINT'),
53 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
54 | ],
55 |
56 | ],
57 |
58 | /*
59 | |--------------------------------------------------------------------------
60 | | Symbolic Links
61 | |--------------------------------------------------------------------------
62 | |
63 | | Here you may configure the symbolic links that will be created when the
64 | | `storage:link` Artisan command is executed. The array keys should be
65 | | the locations of the links and the values should be their targets.
66 | |
67 | */
68 |
69 | 'links' => [
70 | public_path('storage') => storage_path('app/public'),
71 | ],
72 |
73 | ];
74 |
--------------------------------------------------------------------------------
/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' => 1024,
48 | 'threads' => 2,
49 | 'time' => 2,
50 | ],
51 |
52 | ];
53 |
--------------------------------------------------------------------------------
/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' => SyslogUdpHandler::class,
82 | 'handler_with' => [
83 | 'host' => env('PAPERTRAIL_URL'),
84 | 'port' => env('PAPERTRAIL_PORT'),
85 | ],
86 | ],
87 |
88 | 'stderr' => [
89 | 'driver' => 'monolog',
90 | 'level' => env('LOG_LEVEL', 'debug'),
91 | 'handler' => StreamHandler::class,
92 | 'formatter' => env('LOG_STDERR_FORMATTER'),
93 | 'with' => [
94 | 'stream' => 'php://stderr',
95 | ],
96 | ],
97 |
98 | 'syslog' => [
99 | 'driver' => 'syslog',
100 | 'level' => env('LOG_LEVEL', 'debug'),
101 | ],
102 |
103 | 'errorlog' => [
104 | 'driver' => 'errorlog',
105 | 'level' => env('LOG_LEVEL', 'debug'),
106 | ],
107 |
108 | 'null' => [
109 | 'driver' => 'monolog',
110 | 'handler' => NullHandler::class,
111 | ],
112 |
113 | 'emergency' => [
114 | 'path' => storage_path('logs/laravel.log'),
115 | ],
116 | ],
117 |
118 | ];
119 |
--------------------------------------------------------------------------------
/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 | 'auth_mode' => null,
46 | ],
47 |
48 | 'ses' => [
49 | 'transport' => 'ses',
50 | ],
51 |
52 | 'mailgun' => [
53 | 'transport' => 'mailgun',
54 | ],
55 |
56 | 'postmark' => [
57 | 'transport' => 'postmark',
58 | ],
59 |
60 | 'sendmail' => [
61 | 'transport' => 'sendmail',
62 | 'path' => '/usr/sbin/sendmail -bs',
63 | ],
64 |
65 | 'log' => [
66 | 'transport' => 'log',
67 | 'channel' => env('MAIL_LOG_CHANNEL'),
68 | ],
69 |
70 | 'array' => [
71 | 'transport' => 'array',
72 | ],
73 |
74 | 'failover' => [
75 | 'transport' => 'failover',
76 | 'mailers' => [
77 | 'smtp',
78 | 'log',
79 | ],
80 | ],
81 | ],
82 |
83 | /*
84 | |--------------------------------------------------------------------------
85 | | Global "From" Address
86 | |--------------------------------------------------------------------------
87 | |
88 | | You may wish for all e-mails sent by your application to be sent from
89 | | the same address. Here, you may specify a name and address that is
90 | | used globally for all e-mails that are sent by your application.
91 | |
92 | */
93 |
94 | 'from' => [
95 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
96 | 'name' => env('MAIL_FROM_NAME', 'Example'),
97 | ],
98 |
99 | /*
100 | |--------------------------------------------------------------------------
101 | | Markdown Mail Settings
102 | |--------------------------------------------------------------------------
103 | |
104 | | If you are using Markdown based email rendering, you may configure your
105 | | theme and component paths here, allowing you to customize the design
106 | | of the emails. Or, you may simply stick with the Laravel defaults!
107 | |
108 | */
109 |
110 | 'markdown' => [
111 | 'theme' => 'default',
112 |
113 | 'paths' => [
114 | resource_path('views/vendor/mail'),
115 | ],
116 | ],
117 |
118 | ];
119 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/config/sanctum.php:
--------------------------------------------------------------------------------
1 | explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
17 | '%s%s',
18 | 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
19 | env('APP_URL') ? ','.parse_url(env('APP_URL'), PHP_URL_HOST) : ''
20 | ))),
21 |
22 | /*
23 | |--------------------------------------------------------------------------
24 | | Expiration Minutes
25 | |--------------------------------------------------------------------------
26 | |
27 | | This value controls the number of minutes until an issued token will be
28 | | considered expired. If this value is null, personal access tokens do
29 | | not expire. This won't tweak the lifetime of first-party sessions.
30 | |
31 | */
32 |
33 | 'expiration' => null,
34 |
35 | /*
36 | |--------------------------------------------------------------------------
37 | | Sanctum Middleware
38 | |--------------------------------------------------------------------------
39 | |
40 | | When authenticating your first-party SPA with Sanctum you may need to
41 | | customize some of the middleware Sanctum uses while processing the
42 | | request. You may change the middleware listed below as required.
43 | |
44 | */
45 |
46 | 'middleware' => [
47 | 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
48 | 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
49 | ],
50 |
51 | ];
52 |
--------------------------------------------------------------------------------
/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => env('MAILGUN_DOMAIN'),
19 | 'secret' => env('MAILGUN_SECRET'),
20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
21 | ],
22 |
23 | 'postmark' => [
24 | 'token' => env('POSTMARK_TOKEN'),
25 | ],
26 |
27 | 'ses' => [
28 | 'key' => env('AWS_ACCESS_KEY_ID'),
29 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
30 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
31 | ],
32 |
33 | ];
34 |
--------------------------------------------------------------------------------
/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/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite*
2 |
--------------------------------------------------------------------------------
/database/factories/CustomerFactory.php:
--------------------------------------------------------------------------------
1 | $this->faker->name(),
19 | 'email' => $this->faker->unique()->safeEmail(),
20 | 'email_verified_at' => now(),
21 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
22 | 'remember_token' => Str::random(10),
23 | ];
24 | }
25 |
26 | /**
27 | * Indicate that the model's email address should be unverified.
28 | *
29 | * @return \Illuminate\Database\Eloquent\Factories\Factory
30 | */
31 | public function unverified()
32 | {
33 | return $this->state(function (array $attributes) {
34 | return [
35 | 'email_verified_at' => null,
36 | ];
37 | });
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_000000_create_users_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('name');
19 | $table->string('username')->nullable();
20 | $table->string('phone')->nullable();
21 | $table->string('email')->unique();
22 | $table->timestamp('email_verified_at')->nullable();
23 | $table->string('password');
24 | $table->rememberToken();
25 | $table->timestamps();
26 | });
27 | }
28 |
29 | /**
30 | * Reverse the migrations.
31 | *
32 | * @return void
33 | */
34 | public function down()
35 | {
36 | Schema::dropIfExists('users');
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/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/migrations/2019_08_19_000000_create_failed_jobs_table.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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/database/migrations/2021_11_16_113145_create_products_table.php:
--------------------------------------------------------------------------------
1 | id();
14 | $table->text('product_name')->nullable();
15 | $table->integer('product_qty')->nullable();
16 | $table->text('product_desc')->nullable();
17 | $table->integer('product_price')->nullable();
18 | $table->timestamps();
19 | });
20 | }
21 |
22 | public function down()
23 | {
24 | Schema::dropIfExists('products');
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/database/migrations/2021_11_16_113916_create_customers_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('name')->nullable();
19 | $table->string('phone')->nullable();
20 | $table->string('email')->unique();
21 | $table->string('address_1')->unique();
22 | $table->string('address_2')->unique();
23 | $table->string('city')->unique();
24 | $table->string('country')->unique();
25 | $table->string('post_code')->unique();
26 |
27 | $table->string('ship_name')->nullable();
28 | $table->string('ship_phone')->nullable();
29 | $table->string('ship_email')->nullable();
30 | $table->string('ship_address_1')->unique();
31 | $table->string('ship_address_2')->unique();
32 | $table->string('ship_city')->unique();
33 | $table->string('ship_country')->unique();
34 | $table->string('ship_post_code')->unique();
35 | $table->timestamps();
36 | });
37 | }
38 |
39 | /**
40 | * Reverse the migrations.
41 | *
42 | * @return void
43 | */
44 | public function down()
45 | {
46 | Schema::dropIfExists('customers');
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/database/migrations/2021_11_16_114001_create_invoices_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('email')->nullable();
19 | $table->date('invoice_date')->nullable();
20 | $table->date('invoice_due_date')->nullable();
21 | $table->decimal('subtotal', 2)->default(0);
22 | $table->decimal('shipping', 2)->default(0);
23 | $table->decimal('discount', 2)->default(0);
24 | $table->decimal('vat', 2)->default(0);
25 | $table->decimal('total', 2)->default(0);
26 | $table->text('notes')->nullable();
27 | $table->string('invoice_type')->nullable();
28 | $table->string('status')->default(0);
29 | $table->timestamps();
30 | });
31 | }
32 |
33 | /**
34 | * Reverse the migrations.
35 | *
36 | * @return void
37 | */
38 | public function down()
39 | {
40 | Schema::dropIfExists('invoices');
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/database/migrations/2021_11_16_114020_create_invoice_details_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->foreignId('invoice_id')->nullable()->constrained('invoices')->onDelete('cascade')->onUpdate('cascade');
19 | $table->foreignId('product_id')->nullable()->constrained('products')->onDelete('cascade')->onUpdate('cascade');
20 | $table->integer('qty')->default(0);
21 | $table->integer('price')->default(0);
22 | $table->decimal('discount', 2)->default(0);
23 | $table->decimal('subtotal', 2)->default(0);
24 | $table->timestamps();
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | *
31 | * @return void
32 | */
33 | public function down()
34 | {
35 | Schema::dropIfExists('invoice_details');
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/database/migrations/2021_11_16_114144_create_members_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('name')->nullable();
19 | $table->string('phone')->nullable();
20 | $table->string('email')->unique();
21 | $table->string('address_1')->unique();
22 | $table->string('address_2')->unique();
23 | $table->string('city')->unique();
24 | $table->string('country')->unique();
25 | $table->string('post_code')->unique();
26 |
27 | $table->string('ship_name')->nullable();
28 | $table->string('ship_phone')->nullable();
29 | $table->string('ship_email')->nullable();
30 | $table->string('ship_address_1')->unique();
31 | $table->string('ship_address_2')->unique();
32 | $table->string('ship_city')->unique();
33 | $table->string('ship_country')->unique();
34 | $table->string('ship_post_code')->unique();
35 | $table->timestamps();
36 | });
37 | }
38 |
39 | /**
40 | * Reverse the migrations.
41 | *
42 | * @return void
43 | */
44 | public function down()
45 | {
46 | Schema::dropIfExists('members');
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/database/migrations/2021_11_17_172832_create_settings_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('company_name')->nullable();
19 | $table->string('company_email')->unique()->nullable();
20 | $table->string('company_phone')->nullable();
21 | $table->string('company_address_1')->nullable();
22 | $table->string('company_address_2')->nullable();
23 | $table->string('company_address_3')->nullable();
24 | $table->string('company_country')->nullable();
25 | $table->string('company_postcode')->nullable();
26 | $table->string('currency')->nullable();
27 | $table->string('enable_tax')->default('true');
28 | $table->string('include_tax')->default('false');
29 | $table->string('tax_rate')->nullable();
30 | $table->string('invoice_prefix')->default('INV');
31 | $table->string('invoice_initial_value')->default(1);
32 | $table->string('invoice_theme')->default('#222222');
33 | $table->string('company_logo')->nullable();
34 | $table->string('company_logo_width')->default(300);
35 | $table->string('company_logo_height')->default(90);
36 | $table->timestamps();
37 | });
38 | }
39 |
40 | /**
41 | * Reverse the migrations.
42 | *
43 | * @return void
44 | */
45 | public function down()
46 | {
47 | Schema::dropIfExists('settings');
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/database/seeders/CustomerSeeder.php:
--------------------------------------------------------------------------------
1 | create();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/database/seeders/InvoiceDetailSeeder.php:
--------------------------------------------------------------------------------
1 |
2 |
SN | 5 |User Name | 6 |Username | 7 |User Email | 8 |User Phone | 9 |Actions | 10 | 11 |
---|
SN | 5 |Name | 6 |Phone | 8 | @if (!Request::is('invoices*')) 9 |Country | 10 | @endif 11 |Actions | 12 | 13 |
---|
Total Invoices
14 |Paid Invoice Billis
29 |Pending Invoice Bills
44 |Due Amount
59 |Total Sales Amount
82 |Total Products
97 |Total Customers
112 |Total Users
129 |SN | 5 |Invoice Number | 6 |Customer | 7 |Issue Date | 8 |Due Date | 9 |Type | 10 |Status | 11 |Actions | 12 | 13 |
---|