diff --git a/.env.example b/.env.example deleted file mode 100644 index a9fa2b4..0000000 --- a/.env.example +++ /dev/null @@ -1,38 +0,0 @@ -IS_DEMO=false - -APP_NAME=Laravel -APP_ENV=local -APP_KEY= -APP_DEBUG=true -APP_URL=http://localhost - -LOG_CHANNEL=stack -LOG_LEVEL=debug - -DB_CONNECTION=mysql -DB_HOST=127.0.0.1 -DB_PORT=3306 -DB_DATABASE= -DB_USERNAME= -DB_PASSWORD= - -BROADCAST_DRIVER=log -CACHE_DRIVER=file -QUEUE_CONNECTION=sync -SESSION_DRIVER=file -SESSION_LIFETIME=120 - -MEMCACHED_HOST=127.0.0.1 - -REDIS_HOST=127.0.0.1 -REDIS_PASSWORD=null -REDIS_PORT=6379 - -MAIL_MAILER=smtp -MAIL_HOST=smtp.mailtrap.io -MAIL_PORT=2525 -MAIL_USERNAME= -MAIL_PASSWORD= -MAIL_ENCRYPTION=tls - -IS_DEMO=false diff --git a/README.md b/README.md index 9b55a66..e944e65 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ Also, you will need to install Composer: https://getcomposer.org/doc/00-intro.md ## Usage -Register a user or login using admin@volt.com and secret and start testing the Laravel app (make sure to run the migrations and seeders for these credentials to be available). +Register a user or login using admin@gmail.com and secret and start testing the Laravel app (make sure to run the migrations and seeders for these credentials to be available). Make sure to run the migrations and seeders for the above credentials to be available. Make sure to run the migrations and seeders for the above credentials to be available. diff --git a/app/Http/Controllers/AcademicController.php b/app/Http/Controllers/AcademicController.php new file mode 100644 index 0000000..7833fbc --- /dev/null +++ b/app/Http/Controllers/AcademicController.php @@ -0,0 +1,10 @@ + \Illuminate\Routing\Middleware\ValidateSignature::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, + + 'admin' => \App\Http\Middleware\Admin::class, + 'student' => \App\Http\Middleware\Student::class, + 'academic' => \App\Http\Middleware\Academic::class, ]; } diff --git a/app/Http/Livewire/Auth/Login.php b/app/Http/Livewire/Auth/Login.php index 0c7f22d..8537ad0 100644 --- a/app/Http/Livewire/Auth/Login.php +++ b/app/Http/Livewire/Auth/Login.php @@ -4,38 +4,53 @@ use App\Models\User; use Livewire\Component; +use Auth; class Login extends Component { - public $email = ''; public $password = ''; public $remember_me = false; + public $redirectTo; // Change this line to public protected $rules = [ 'email' => 'required|email:rfc,dns', 'password' => 'required|min:6', ]; - //This mounts the default credentials for the admin. Remove this section if you want to make it public. public function mount() { if (auth()->user()) { return redirect()->intended('/dashboard'); } $this->fill([ - 'email' => 'admin@volt.com', + 'email' => 'admin@gmail.com', 'password' => 'secret', ]); } + public function redirectTo() + { + switch (Auth::user()->role) { + case 1: + $this->redirectTo = '/admin'; + return $this->redirectTo; + case 2: + $this->redirectTo = '/user'; + return $this->redirectTo; + default: + $this->redirectTo = '/dashboard'; //if user doesn't have any role + return $this->redirectTo; + } + } + public function login() { $credentials = $this->validate(); if (auth()->attempt(['email' => $this->email, 'password' => $this->password], $this->remember_me)) { $user = User::where(['email' => $this->email])->first(); auth()->login($user, $this->remember_me); - return redirect()->intended('/dashboard'); + return redirect()->intended($this->redirectTo()); // Update this line to use redirectTo method } else { return $this->addError('email', trans('auth.failed')); } diff --git a/app/Http/Livewire/Auth/Register.php b/app/Http/Livewire/Auth/Register.php index ce804f1..2edc541 100644 --- a/app/Http/Livewire/Auth/Register.php +++ b/app/Http/Livewire/Auth/Register.php @@ -9,10 +9,10 @@ class Register extends Component { - public $email = ''; public $password = ''; public $passwordConfirmation = ''; + public $role; public function mount() { @@ -23,25 +23,40 @@ public function mount() public function updatedEmail() { - $this->validate(['email'=>'required|email:rfc,dns|unique:users']); + $this->validate(['email' => 'required|email:rfc,dns|unique:users']); } - + public function register() { $this->validate([ - 'email' => 'required', + 'email' => 'required|email|unique:users', 'password' => 'required|same:passwordConfirmation|min:6', + 'role' => 'required|integer|in:1,2,3', ]); $user = User::create([ - 'email' =>$this->email, + 'email' => $this->email, 'password' => Hash::make($this->password), 'remember_token' => Str::random(10), + 'role' => $this->role, ]); auth()->login($user); - return redirect('/profile'); + // Redirect based on role + return $this->redirectBasedOnRole($user->role); + } + + protected function redirectBasedOnRole($role) + { + switch ($role) { + case 1: + return redirect('/admin'); // Redirect to admin dashboard + case 2: + return redirect('/user'); + default: + return redirect('/dashboard'); // Default fallback + } } public function render() diff --git a/app/Http/Livewire/Dashboard.php b/app/Http/Livewire/Dashboard.php index fcb518d..f5a96de 100644 --- a/app/Http/Livewire/Dashboard.php +++ b/app/Http/Livewire/Dashboard.php @@ -3,11 +3,44 @@ namespace App\Http\Livewire; use Livewire\Component; +use Livewire\WithPagination; +use App\Models\Report; +use Illuminate\Support\Facades\Auth; class Dashboard extends Component { + use WithPagination; // Add pagination trait for Livewire + + public $search = ''; // Initialize search as an empty string + public $confirmingDelete = false; + public $user; + public function render() { - return view('dashboard'); + // Get the authenticated user + $this->user = Auth::user(); + + // Query for reports, applying search filter if present + $query = Report::query(); + + // Apply search filter + if (!empty($this->search)) { + $query->where('item_name', 'like', '%' . $this->search . '%'); + } + + // Get paginated results + $reports = $query->paginate(10); + + // Return view with data + return view('livewire.dashboard', [ + 'user' => $this->user, + 'reports' => $reports + ]); + } + + public function updatingSearch() + { + // Reset pagination when the search term is updated + $this->resetPage(); } } diff --git a/app/Http/Livewire/EditReport.php b/app/Http/Livewire/EditReport.php new file mode 100644 index 0000000..77eb4bb --- /dev/null +++ b/app/Http/Livewire/EditReport.php @@ -0,0 +1,57 @@ +edit($id); // Load the report details for editing + } + } + + public function edit($id) + { + $report = Report::find($id); + + if ($report) { + $this->reportId = $report->id; + $this->item_name = $report->item_name; + $this->item_code = $report->item_code; + $this->generic_item_name = $report->generic_item_name; + $this->item_category = $report->item_category; + $this->department = $report->department; + $this->machine = $report->machine; + $this->test_code = $report->test_code; + $this->test_name = $report->test_name; + $this->supplier_name = $report->supplier_name; + $this->address = $report->address; + $this->manufacture = $report->manufacture; + $this->hsn_code = $report->hsn_code; + $this->unit_of_perchase = $report->unit_of_perchase; + $this->pack_size = $report->pack_size; + $this->test = $report->test; + $this->unit_price = $report->unit_price; + $this->cgst = $report->cgst; + $this->sgst = $report->sgst; + $this->price_gst = $report->price_gst; + return $this->render(); + } else { + // Handle case when the report is not found + session()->flash('error', 'Report not found.'); + } + } + + public function render() + { + return view('livewire.edit-report'); + } +} diff --git a/app/Http/Livewire/Reports.php b/app/Http/Livewire/Reports.php new file mode 100644 index 0000000..1fb8e21 --- /dev/null +++ b/app/Http/Livewire/Reports.php @@ -0,0 +1,155 @@ +edit($id); + } + } + + public function bulkImport() + { + $this->validate(['file' => 'required|mimes:xlsx,csv']); + Excel::import(new ReportsImport, $this->file); + session()->flash('success', 'Reports imported successfully.'); + $this->emit('fileUploaded'); + } + + public function submit() + { + // $this->validate($this->rules()); + Report::create( [ + 'item_category' => $this->item_category, + 'generic_item_name' => $this->generic_item_name, + 'item_name' => $this->item_name, + 'item_code' => $this->item_code, + 'department' => $this->department, + 'machine' => $this->machine, + 'test_code' => $this->test_code, + 'test_name' => $this->test_name, + 'supplier_name' => $this->supplier_name, + 'address' => $this->address, + 'manufacture' => $this->manufacture, + 'hsn_code' => $this->hsn_code, + 'unit_of_perchase' => $this->unit_of_perchase, + 'pack_size' => $this->pack_size, + 'test' => $this->test, + 'unit_price' => $this->unit_price, + 'cgst' => $this->cgst, + 'sgst' => $this->sgst, + 'price_gst' => $this->price_gst, + ]); + session()->flash('success', 'Report created successfully.'); + $this->resetInputFields(); + } + + public function updateReport() + { + $this->validate($this->rules()); + $report = Report::find($this->reportId); + $report->update($this->formData()); + session()->flash('success', 'Report updated successfully.'); + $this->isEditing = false; + $this->resetInputFields(); + } + + public function edit($id) + { + $this->isEditing = true; + $report = Report::find($id); + $this->reportId = $report->id; + $this->item_name = $report->item_name; + $this->item_code = $report->item_code; + $this->generic_item_name = $report->generic_item_name; + $this->item_category = $report->item_category; + $this->department = $report->department; + $this->machine = $report->machine; + $this->test_code = $report->test_code; + $this->test_name = $report->test_name; + $this->supplier_name = $report->supplier_name; + $this->address = $report->address; + $this->manufacture = $report->manufacture; + $this->hsn_code = $report->hsn_code; + $this->unit_of_perchase = $report->unit_of_perchase; + $this->pack_size = $report->pack_size; + $this->test = $report->test; + $this->unit_price = $report->unit_price; + $this->cgst = $report->cgst; + $this->sgst = $report->sgst; + $this->price_gst = $report->price_gst; + return view('livewire.reports',['isEditing' => $this->isEditing]); + } + public function download() + { + $filePath = public_path('assets/bulkimport.xlsx'); + + return Response::download($filePath); + } + public function resetInputFields() + { + $this->item_name = ''; + $this->item_code = ''; + $this->generic_item_name = ''; + $this->item_category = ''; + $this->department = ''; + $this->machine = ''; + $this->test_code = ''; + $this->test_name = ''; + $this->supplier_name = ''; + $this->address = ''; + $this->manufacture = ''; + $this->hsn_code = ''; + $this->unit_of_perchase = ''; + $this->pack_size = ''; + $this->test = ''; + $this->unit_price = ''; + $this->cgst = ''; + $this->sgst = ''; + $this->price_gst = ''; + } + + protected function rules() + { + return [ + 'item_name' => 'required|string', + 'item_code' => 'required|string', + 'generic_item_name' => 'nullable|string', + 'item_category' => 'nullable|string', + 'department' => 'nullable|string', + 'machine' => 'nullable|string', + 'test_code' => 'nullable|string', + 'test_name' => 'nullable|string', + 'supplier_name' => 'nullable|string', + 'address' => 'nullable|string', + 'manufacture' => 'nullable|string', + 'hsn_code' => 'nullable|string', + 'unit_of_perchase' => 'nullable|string', + 'pack_size' => 'nullable|string', + 'test' => 'nullable|string', + 'unit_price' => 'nullable|numeric', + 'cgst' => 'nullable|numeric', + 'sgst' => 'nullable|numeric', + 'price_gst' => 'nullable|numeric', + ]; + } + + public function render() + { + return view('livewire.reports'); + } +} diff --git a/app/Http/Livewire/SearchReports.php b/app/Http/Livewire/SearchReports.php new file mode 100644 index 0000000..15c8c08 --- /dev/null +++ b/app/Http/Livewire/SearchReports.php @@ -0,0 +1,55 @@ +reports = Report::all(); // Load all records initially + } + + public function updatedSearchTest() // Triggered when the searchTest changes + { + $this->searchFeedMessage(); // Call the search method when input changes + } + + public function searchFeedMessage() + { + if ($this->searchTest !== '') { + // Filter reports based on search input + $this->reports = Report::where('test', 'like', '%' . $this->searchTest . '%')->get(); + } else { + // Reset reports to show all records when the search input is empty + $this->reports = Report::all(); + } + } + + public function updatedSearchItem() // Triggered when the searchTest changes + { + $this->searchItemReports(); // Call the search method when input changes + } + + public function searchItemReports() + { + if ($this->searchItem !== '') { + // Filter reports based on search input + $this->reports = Report::where('item_name', 'like', '%' . $this->searchItem . '%')->get(); + } else { + // Reset reports to show all records when the search input is empty + $this->reports = Report::all(); + } + } + + public function render() + { + // Pass the current reports to the view + return view('livewire.search-reports', ['reports' => $this->reports]); + } +} diff --git a/app/Http/Middleware/Academic.php b/app/Http/Middleware/Academic.php new file mode 100644 index 0000000..9825fd9 --- /dev/null +++ b/app/Http/Middleware/Academic.php @@ -0,0 +1,20 @@ +route('login'); + } + + // Handle role-based redirection + switch (Auth::user()->role) { + case 1: + // Admin, allow access to the request + return $next($request); + + case 2: + // Redirect academic users to the academic dashboard + return redirect()->route('user'); + + default: + // Redirect back if role does not match (user is trying to access an unauthorized dashboard) + return back()->with('error', 'Unauthorized access.'); + } + } +} diff --git a/app/Http/Middleware/Student.php b/app/Http/Middleware/Student.php new file mode 100644 index 0000000..b872fa4 --- /dev/null +++ b/app/Http/Middleware/Student.php @@ -0,0 +1,39 @@ +route('login'); + } + + // Handle role-based redirection + switch (Auth::user()->role) { + case 1: + // Admin, allow access to the request + return $next($request); + + case 2: + // Redirect academic users to the academic dashboard + return redirect()->route('user'); + + default: + // Redirect back if role does not match (user is trying to access an unauthorized dashboard) + return back()->with('error', 'Unauthorized access.'); + } + } +} diff --git a/app/Imports/ReportsImport.php b/app/Imports/ReportsImport.php new file mode 100644 index 0000000..444a84e --- /dev/null +++ b/app/Imports/ReportsImport.php @@ -0,0 +1,43 @@ + $row[0], + 'item_code' => $row[1], + 'generic_item_name' => $row[2], + 'item_category' => $row[3], + 'department' => $row[4], + 'machine' => $row[5], + 'test_code' => $row[6], + 'test_name' => $row[7], + 'supplier_name' => $row[8], + 'address' => $row[9], + 'manufacture' => $row[10], + 'hsn_code' => $row[11], + 'unit_of_perchase' => $row[12], + 'pack_size' => $row[13], + 'test' => $row[14], + 'unit_price' => $row[15], + 'cgst' => $row[16], + 'sgst' => $row[17], + 'price_gst' => $row[18], + ]); + } +} + diff --git a/app/Models/Report.php b/app/Models/Report.php new file mode 100644 index 0000000..7269d50 --- /dev/null +++ b/app/Models/Report.php @@ -0,0 +1,32 @@ + 'datetime', ]; + + + public function role() + { + return $this->belongsTo(Role::class); + } } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index ee8ca5b..9242dee 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -3,6 +3,7 @@ namespace App\Providers; use Illuminate\Support\ServiceProvider; +use Illuminate\Support\Facades\Schema; class AppServiceProvider extends ServiceProvider { @@ -23,6 +24,6 @@ public function register() */ public function boot() { - // + Schema::defaultStringLength(191); } } diff --git a/composer.json b/composer.json index 695b29f..97da1d2 100644 --- a/composer.json +++ b/composer.json @@ -7,9 +7,11 @@ "require": { "php": "^8.1", "guzzlehttp/guzzle": "^7.4", + "jantinnerezo/livewire-alert": "^3.0", "laravel/framework": "^10.0", "laravel/tinker": "^2.6", - "livewire/livewire": "^2.8" + "livewire/livewire": "^2.8", + "maatwebsite/excel": "^3.1" }, "require-dev": { "spatie/laravel-ignition": "^2.0", diff --git a/composer.lock b/composer.lock index 051cec0..9eaba69 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "72f792372d436194aecd4128111c8639", + "content-hash": "a2f90bba9abb07161b1721a0d94d858a", "packages": [ { "name": "brick/math", @@ -61,6 +61,87 @@ ], "time": "2023-01-15T23:15:59+00:00" }, + { + "name": "composer/semver", + "version": "3.4.3", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-09-19T14:15:21+00:00" + }, { "name": "dflydev/dot-access-data", "version": "v3.0.2", @@ -432,6 +513,67 @@ ], "time": "2023-01-14T14:17:03+00:00" }, + { + "name": "ezyang/htmlpurifier", + "version": "v4.17.0", + "source": { + "type": "git", + "url": "https://github.com/ezyang/htmlpurifier.git", + "reference": "bbc513d79acf6691fa9cf10f192c90dd2957f18c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/bbc513d79acf6691fa9cf10f192c90dd2957f18c", + "reference": "bbc513d79acf6691fa9cf10f192c90dd2957f18c", + "shasum": "" + }, + "require": { + "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0" + }, + "require-dev": { + "cerdic/css-tidy": "^1.7 || ^2.0", + "simpletest/simpletest": "dev-master" + }, + "suggest": { + "cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.", + "ext-bcmath": "Used for unit conversion and imagecrash protection", + "ext-iconv": "Converts text to and from non-UTF-8 encodings", + "ext-tidy": "Used for pretty-printing HTML" + }, + "type": "library", + "autoload": { + "files": [ + "library/HTMLPurifier.composer.php" + ], + "psr-0": { + "HTMLPurifier": "library/" + }, + "exclude-from-classmap": [ + "/library/HTMLPurifier/Language/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-or-later" + ], + "authors": [ + { + "name": "Edward Z. Yang", + "email": "admin@htmlpurifier.org", + "homepage": "http://ezyang.com" + } + ], + "description": "Standards compliant HTML filter written in PHP", + "homepage": "http://htmlpurifier.org/", + "keywords": [ + "html" + ], + "support": { + "issues": "https://github.com/ezyang/htmlpurifier/issues", + "source": "https://github.com/ezyang/htmlpurifier/tree/v4.17.0" + }, + "time": "2023-11-17T15:01:25+00:00" + }, { "name": "fruitcake/php-cors", "version": "v1.2.0", @@ -980,6 +1122,68 @@ ], "time": "2021-10-07T12:57:01+00:00" }, + { + "name": "jantinnerezo/livewire-alert", + "version": "v3.0", + "source": { + "type": "git", + "url": "https://github.com/jantinnerezo/livewire-alert.git", + "reference": "53a4c04d413528a335864f5f6eb1f3ce3e42c963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jantinnerezo/livewire-alert/zipball/53a4c04d413528a335864f5f6eb1f3ce3e42c963", + "reference": "53a4c04d413528a335864f5f6eb1f3ce3e42c963", + "shasum": "" + }, + "require": { + "illuminate/support": "^5.5 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0", + "livewire/livewire": "^2.0", + "php": "^7.4|^8.0|^8.1|^8.2" + }, + "require-dev": { + "orchestra/testbench": "^6.15|^7.0|^8.0", + "phpunit/phpunit": "^9.5|^10.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Jantinnerezo\\LivewireAlert\\LivewireAlertServiceProvider" + ], + "aliases": { + "LivewireAlert": "Jantinnerezo\\LivewireAlert\\LivewireAlertFacade" + } + } + }, + "autoload": { + "psr-4": { + "Jantinnerezo\\LivewireAlert\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jantinn Erezo", + "email": "erezojantinn@gmail.com", + "role": "Developer" + } + ], + "description": "This package provides a simple alert utilities for your livewire components.", + "homepage": "https://github.com/jantinnerezo/livewire-alert", + "keywords": [ + "jantinnerezo", + "livewire-alert" + ], + "support": { + "issues": "https://github.com/jantinnerezo/livewire-alert/issues", + "source": "https://github.com/jantinnerezo/livewire-alert/tree/v3.0" + }, + "time": "2023-07-21T18:17:43+00:00" + }, { "name": "laravel/framework", "version": "v10.3.3", @@ -1716,6 +1920,275 @@ ], "time": "2023-03-03T20:12:38+00:00" }, + { + "name": "maatwebsite/excel", + "version": "3.1.58", + "source": { + "type": "git", + "url": "https://github.com/SpartnerNL/Laravel-Excel.git", + "reference": "18495a71b112f43af8ffab35111a58b4e4ba4a4d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/SpartnerNL/Laravel-Excel/zipball/18495a71b112f43af8ffab35111a58b4e4ba4a4d", + "reference": "18495a71b112f43af8ffab35111a58b4e4ba4a4d", + "shasum": "" + }, + "require": { + "composer/semver": "^3.3", + "ext-json": "*", + "illuminate/support": "5.8.*||^6.0||^7.0||^8.0||^9.0||^10.0||^11.0", + "php": "^7.0||^8.0", + "phpoffice/phpspreadsheet": "^1.29.1", + "psr/simple-cache": "^1.0||^2.0||^3.0" + }, + "require-dev": { + "laravel/scout": "^7.0||^8.0||^9.0||^10.0", + "orchestra/testbench": "^6.0||^7.0||^8.0||^9.0", + "predis/predis": "^1.1" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Maatwebsite\\Excel\\ExcelServiceProvider" + ], + "aliases": { + "Excel": "Maatwebsite\\Excel\\Facades\\Excel" + } + } + }, + "autoload": { + "psr-4": { + "Maatwebsite\\Excel\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Patrick Brouwers", + "email": "patrick@spartner.nl" + } + ], + "description": "Supercharged Excel exports and imports in Laravel", + "keywords": [ + "PHPExcel", + "batch", + "csv", + "excel", + "export", + "import", + "laravel", + "php", + "phpspreadsheet" + ], + "support": { + "issues": "https://github.com/SpartnerNL/Laravel-Excel/issues", + "source": "https://github.com/SpartnerNL/Laravel-Excel/tree/3.1.58" + }, + "funding": [ + { + "url": "https://laravel-excel.com/commercial-support", + "type": "custom" + }, + { + "url": "https://github.com/patrickbrouwers", + "type": "github" + } + ], + "time": "2024-09-07T13:53:36+00:00" + }, + { + "name": "maennchen/zipstream-php", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/maennchen/ZipStream-PHP.git", + "reference": "b8174494eda667f7d13876b4a7bfef0f62a7c0d1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/b8174494eda667f7d13876b4a7bfef0f62a7c0d1", + "reference": "b8174494eda667f7d13876b4a7bfef0f62a7c0d1", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "ext-zlib": "*", + "php-64bit": "^8.1" + }, + "require-dev": { + "ext-zip": "*", + "friendsofphp/php-cs-fixer": "^3.16", + "guzzlehttp/guzzle": "^7.5", + "mikey179/vfsstream": "^1.6", + "php-coveralls/php-coveralls": "^2.5", + "phpunit/phpunit": "^10.0", + "vimeo/psalm": "^5.0" + }, + "suggest": { + "guzzlehttp/psr7": "^2.4", + "psr/http-message": "^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "ZipStream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paul Duncan", + "email": "pabs@pablotron.org" + }, + { + "name": "Jonatan Männchen", + "email": "jonatan@maennchen.ch" + }, + { + "name": "Jesse Donat", + "email": "donatj@gmail.com" + }, + { + "name": "András Kolesár", + "email": "kolesar@kolesar.hu" + } + ], + "description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.", + "keywords": [ + "stream", + "zip" + ], + "support": { + "issues": "https://github.com/maennchen/ZipStream-PHP/issues", + "source": "https://github.com/maennchen/ZipStream-PHP/tree/3.1.0" + }, + "funding": [ + { + "url": "https://github.com/maennchen", + "type": "github" + }, + { + "url": "https://opencollective.com/zipstream", + "type": "open_collective" + } + ], + "time": "2023-06-21T14:59:35+00:00" + }, + { + "name": "markbaker/complex", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPComplex.git", + "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/95c56caa1cf5c766ad6d65b6344b807c1e8405b9", + "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-master", + "phpcompatibility/php-compatibility": "^9.3", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "squizlabs/php_codesniffer": "^3.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Complex\\": "classes/src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Baker", + "email": "mark@lange.demon.co.uk" + } + ], + "description": "PHP Class for working with complex numbers", + "homepage": "https://github.com/MarkBaker/PHPComplex", + "keywords": [ + "complex", + "mathematics" + ], + "support": { + "issues": "https://github.com/MarkBaker/PHPComplex/issues", + "source": "https://github.com/MarkBaker/PHPComplex/tree/3.0.2" + }, + "time": "2022-12-06T16:21:08+00:00" + }, + { + "name": "markbaker/matrix", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPMatrix.git", + "reference": "728434227fe21be27ff6d86621a1b13107a2562c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/728434227fe21be27ff6d86621a1b13107a2562c", + "reference": "728434227fe21be27ff6d86621a1b13107a2562c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-master", + "phpcompatibility/php-compatibility": "^9.3", + "phpdocumentor/phpdocumentor": "2.*", + "phploc/phploc": "^4.0", + "phpmd/phpmd": "2.*", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "sebastian/phpcpd": "^4.0", + "squizlabs/php_codesniffer": "^3.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Matrix\\": "classes/src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Baker", + "email": "mark@demon-angel.eu" + } + ], + "description": "PHP Class for working with matrices", + "homepage": "https://github.com/MarkBaker/PHPMatrix", + "keywords": [ + "mathematics", + "matrix", + "vector" + ], + "support": { + "issues": "https://github.com/MarkBaker/PHPMatrix/issues", + "source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.1" + }, + "time": "2022-12-02T22:17:43+00:00" + }, { "name": "monolog/monolog", "version": "3.3.1", @@ -2210,6 +2683,111 @@ ], "time": "2023-02-08T01:06:31+00:00" }, + { + "name": "phpoffice/phpspreadsheet", + "version": "1.29.1", + "source": { + "type": "git", + "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", + "reference": "59ee38f7480904cd6487e5cbdea4d80ff2758719" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/59ee38f7480904cd6487e5cbdea4d80ff2758719", + "reference": "59ee38f7480904cd6487e5cbdea4d80ff2758719", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-dom": "*", + "ext-fileinfo": "*", + "ext-gd": "*", + "ext-iconv": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-simplexml": "*", + "ext-xml": "*", + "ext-xmlreader": "*", + "ext-xmlwriter": "*", + "ext-zip": "*", + "ext-zlib": "*", + "ezyang/htmlpurifier": "^4.15", + "maennchen/zipstream-php": "^2.1 || ^3.0", + "markbaker/complex": "^3.0", + "markbaker/matrix": "^3.0", + "php": "^7.4 || ^8.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/simple-cache": "^1.0 || ^2.0 || ^3.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-main", + "dompdf/dompdf": "^1.0 || ^2.0", + "friendsofphp/php-cs-fixer": "^3.2", + "mitoteam/jpgraph": "^10.3", + "mpdf/mpdf": "^8.1.1", + "phpcompatibility/php-compatibility": "^9.3", + "phpstan/phpstan": "^1.1", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^8.5 || ^9.0", + "squizlabs/php_codesniffer": "^3.7", + "tecnickcom/tcpdf": "^6.5" + }, + "suggest": { + "dompdf/dompdf": "Option for rendering PDF with PDF Writer", + "ext-intl": "PHP Internationalization Functions", + "mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers", + "mpdf/mpdf": "Option for rendering PDF with PDF Writer", + "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Maarten Balliauw", + "homepage": "https://blog.maartenballiauw.be" + }, + { + "name": "Mark Baker", + "homepage": "https://markbakeruk.net" + }, + { + "name": "Franck Lefevre", + "homepage": "https://rootslabs.net" + }, + { + "name": "Erik Tilt" + }, + { + "name": "Adrien Crivelli" + } + ], + "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine", + "homepage": "https://github.com/PHPOffice/PhpSpreadsheet", + "keywords": [ + "OpenXML", + "excel", + "gnumeric", + "ods", + "php", + "spreadsheet", + "xls", + "xlsx" + ], + "support": { + "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues", + "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.29.1" + }, + "time": "2024-09-03T00:55:32+00:00" + }, { "name": "phpoption/phpoption", "version": "1.9.1", @@ -7764,5 +8342,5 @@ "php": "^8.1" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/database/factories/RoleFactory.php b/database/factories/RoleFactory.php new file mode 100644 index 0000000..042e6a3 --- /dev/null +++ b/database/factories/RoleFactory.php @@ -0,0 +1,18 @@ + $this->faker->unique()->word, + ]; + } +} diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 7d2bb19..01a291a 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -2,7 +2,7 @@ namespace Database\Factories; -use App\Models\User; +use App\Models\{User , Role}; use Illuminate\Support\Arr; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Str; @@ -35,6 +35,7 @@ public function definition() 'ZIP' => $this->faker->randomNumber(6), 'number' => $this->faker->buildingNumber, 'remember_token' => Str::random(10), + 'role_id' => Role::factory(), ]; } diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index fdb401f..e5ad22e 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -20,6 +20,7 @@ public function up() $table->string('gender')->nullable(); $table->string('email')->unique(); $table->string('password'); + $table->integer('role')->nullable(); $table->string('address')->nullable(); $table->string('number')->nullable(); $table->string('city')->nullable(); diff --git a/database/migrations/2024_09_23_071602_reports.php b/database/migrations/2024_09_23_071602_reports.php new file mode 100644 index 0000000..ea0a158 --- /dev/null +++ b/database/migrations/2024_09_23_071602_reports.php @@ -0,0 +1,47 @@ +increments('id')->unique(); + $table->string('item_name')->nullable(); + $table->string('item_code')->nullable(); + $table->string('generic_item_name')->nullable(); + $table->string('item_category')->nullable(); + $table->string('department')->nullable(); + $table->string('machine')->nullable(); + $table->string('test_code')->nullable(); + $table->string('test_name')->nullable(); + $table->string('supplier_name')->nullable(); + $table->string('address')->nullable(); + $table->string('manufacture')->nullable(); + $table->string('hsn_code')->nullable(); + $table->string('unit_of_perchase')->nullable(); + $table->string('pack_size')->nullable(); + $table->string('test')->nullable(); + $table->string('unit_price')->nullable(); + $table->string('cgst')->nullable(); + $table->string('sgst')->nullable(); + $table->string('price_gst')->nullable(); + $table->timestamps(); + }); + + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('reports'); + } +}; diff --git a/database/migrations/2024_09_24_103007_add_role_to_users_table.php b/database/migrations/2024_09_24_103007_add_role_to_users_table.php new file mode 100644 index 0000000..d39f123 --- /dev/null +++ b/database/migrations/2024_09_24_103007_add_role_to_users_table.php @@ -0,0 +1,26 @@ +tinyInteger('role')->default(1)->after('password'); // Adjust the position as needed + }); + } + + public function down() + { + Schema::table('users', function (Blueprint $table) { + $table->dropColumn('role'); + }); + } + +}; diff --git a/database/migrations/2024_09_24_103711_create_roles_table.php b/database/migrations/2024_09_24_103711_create_roles_table.php new file mode 100644 index 0000000..87bd721 --- /dev/null +++ b/database/migrations/2024_09_24_103711_create_roles_table.php @@ -0,0 +1,28 @@ +id(); + $table->string('name')->unique(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('roles'); + } +}; diff --git a/database/seeders/RoleSeeder.php b/database/seeders/RoleSeeder.php new file mode 100644 index 0000000..8fb6fc8 --- /dev/null +++ b/database/seeders/RoleSeeder.php @@ -0,0 +1,15 @@ + 'admin']); + Role::create(['name' => 'user']); + } +} diff --git a/database/seeders/UserSeeder.php b/database/seeders/UserSeeder.php index 0843834..d2e590a 100644 --- a/database/seeders/UserSeeder.php +++ b/database/seeders/UserSeeder.php @@ -18,8 +18,9 @@ public function run() DB::table("users")->insert([ 'first_name' => 'Admin', 'last_name' => 'User', - 'email' => 'admin@volt.com', + 'email' => 'admin@gmail.com', 'password' => Hash::make('secret'), + 'role' => '1' ]); } } diff --git a/public/assets/bulkimport.xlsx b/public/assets/bulkimport.xlsx new file mode 100644 index 0000000..2ada455 Binary files /dev/null and b/public/assets/bulkimport.xlsx differ diff --git a/public/assets/img/SHLlogo.png.crdownload b/public/assets/img/SHLlogo.png.crdownload new file mode 100644 index 0000000..b4106c5 Binary files /dev/null and b/public/assets/img/SHLlogo.png.crdownload differ diff --git a/public/assets/img/circle.jpg b/public/assets/img/circle.jpg new file mode 100644 index 0000000..5b13587 Binary files /dev/null and b/public/assets/img/circle.jpg differ diff --git a/public/assets/img/icons/trustlogo.png b/public/assets/img/icons/trustlogo.png new file mode 100644 index 0000000..59a6a6a Binary files /dev/null and b/public/assets/img/icons/trustlogo.png differ diff --git a/public/assets/img/illustrations/add-circle-svgrepo-com.svg b/public/assets/img/illustrations/add-circle-svgrepo-com.svg new file mode 100644 index 0000000..b46319f --- /dev/null +++ b/public/assets/img/illustrations/add-circle-svgrepo-com.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/public/assets/img/logo.png b/public/assets/img/logo.png new file mode 100644 index 0000000..b4106c5 Binary files /dev/null and b/public/assets/img/logo.png differ diff --git a/public/css/volt.css b/public/css/volt.css index 271d693..78482b9 100644 --- a/public/css/volt.css +++ b/public/css/volt.css @@ -811,7 +811,7 @@ --bs-white: #ffffff; --bs-gray: #4B5563; --bs-gray-dark: #1F2937; - --bs-primary: #1F2937; + --bs-primary: #1c55e6; --bs-secondary: #fb503b; --bs-tertiary: #31316A; --bs-success: #10B981; @@ -2575,7 +2575,7 @@ progress { .table-primary { --bs-table-bg: #d2d4d7; --bs-table-striped-bg: #c9cbcf; - --bs-table-striped-color: #1F2937; + --bs-table-striped-color: #1b6fe5; --bs-table-active-bg: #c0c3c7; --bs-table-active-color: #1F2937; --bs-table-hover-bg: #c5c7cb; @@ -3338,32 +3338,32 @@ textarea.form-control-lg { .btn-primary { color: #ffffff; - background-color: #1F2937; - border-color: #1F2937; - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(17, 24, 39, 0.075); } + background-color: #191970; + border-color: #eaf0f0; + box-shadow: inset 0 1px 0 rgba(39, 136, 3, 0.842), 0 0 0 0.18rem rgba(65, 73, 85, 0.5); } .btn-primary:hover { color: #ffffff; - background-color: #1a232f; - border-color: #19212c; } + background-color: #0c9207; + border-color: #0c9207; } .btn-check:focus + .btn-primary, .btn-primary:focus { color: #ffffff; - background-color: #1a232f; - border-color: #19212c; + background-color: #0c9207; + border-color: #0c9207; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(17, 24, 39, 0.075), 0 0 0 0.18rem rgba(65, 73, 85, 0.5); } .btn-check:checked + .btn-primary, .btn-check:active + .btn-primary, .btn-primary:active, .btn-primary.active, .show > .btn-primary.dropdown-toggle { color: #ffffff; - background-color: #19212c; - border-color: #171f29; } + background-color: #0c9207; + border-color: #0c9207; } .btn-check:checked + .btn-primary:focus, .btn-check:active + .btn-primary:focus, .btn-primary:active:focus, .btn-primary.active:focus, .show > .btn-primary.dropdown-toggle:focus { - box-shadow: inset 0 3px 5px rgba(17, 24, 39, 0.125), 0 0 0 0.18rem rgba(65, 73, 85, 0.5); } + box-shadow: inset 0 3px 5px rgba(39, 136, 3, 0.842), 0 0 0 0.18rem rgba(65, 73, 85, 0.5); } .btn-primary:disabled, .btn-primary.disabled { color: #ffffff; - background-color: #1F2937; - border-color: #1F2937; } + background-color: #0c9207; + border-color: #0c9207; } .btn-secondary { color: #ffffff; @@ -4856,7 +4856,7 @@ textarea.form-control-lg { .nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link { color: #374151; - background-color: #9CA3AF; + background-color: #0c9207; border-color: #9CA3AF; } .nav-tabs .dropdown-menu { margin-top: -0.0625rem; @@ -14121,7 +14121,7 @@ textarea.form-control-lg { color: #ffffff; } .navbar-dark > .nav-item:hover > .nav-link { - color: #1F2937; } + color: #0c9207; } .navbar-light:not(.headroom--not-top) .btn-outline-soft { border-color: #1F2937; @@ -14514,7 +14514,7 @@ textarea.form-control-lg { margin-bottom: .2rem; } .sidebar .nav-item.active > .nav-link { color: #F2F4F6; - background-color: #374151; } + background-color: #0c9207; } .sidebar .nav-item .nav-link { color: #ffffff; cursor: pointer; } @@ -18790,7 +18790,8 @@ article .h1, article .h2, article .h3, article .h4, article .h5, article .h6 { right: 0; padding: 0; margin: 0; - -webkit-overflow-scrolling: touch; } + -webkit-overflow-scrolling: touch; + background: midnightblue;} .simplebar-content-wrapper { direction: inherit; diff --git a/public/documentation/getting-started/installation/index.html b/public/documentation/getting-started/installation/index.html index e5a1dca..9550d62 100644 --- a/public/documentation/getting-started/installation/index.html +++ b/public/documentation/getting-started/installation/index.html @@ -490,7 +490,7 @@

Prerequisites

  • Run php artisan storage:link to create the storage symlink (if you are using Vagrant with Homestead for development, remember to ssh into your virtual machine and run the command from there).

  • Usage

    -

    Register a user or login using admin@volt.com and secret and start testing the Laravel app (make sure to run the migrations and seeders for these credentials to be available).

    +

    Register a user or login using admin@gmail.com and secret and start testing the Laravel app (make sure to run the migrations and seeders for these credentials to be available).

    Make sure to run the migrations and seeders for the above credentials to be available.

    Besides the dashboard and the auth pages this application also has an edit profile page. All the necessary files (controllers, requests, views) are installed out of the box and all the needed routes are added to routes/web.php. Keep in mind that all of the features can be viewed once you login using the credentials provided above or by registering your own user.

    diff --git a/public/vendor/livewire-alert/livewire-alert.js b/public/vendor/livewire-alert/livewire-alert.js new file mode 100644 index 0000000..f33108e --- /dev/null +++ b/public/vendor/livewire-alert/livewire-alert.js @@ -0,0 +1 @@ +(()=>{var __webpack_modules__={757:(e,t,r)=>{e.exports=r(666)},666:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var o=t&&t.prototype instanceof y?t:y,i=Object.create(o.prototype),a=new x(n||[]);return i._invoke=function(e,t,r){var n=f;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=L(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var s=u(e,t,r);if("normal"===s.type){if(n=r.done?d:_,s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=d,r.method="throw",r.arg=s.arg)}}}(e,r,a),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var f="suspendedStart",_="suspendedYield",p="executing",d="completed",h={};function y(){}function v(){}function m(){}var b={};s(b,i,(function(){return this}));var w=Object.getPrototypeOf,g=w&&w(w(D([])));g&&g!==r&&n.call(g,i)&&(b=g);var O=m.prototype=y.prototype=Object.create(b);function E(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function r(o,i,a,c){var s=u(e[o],e,i);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,c)}))}c(s.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function L(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,L(e,r),"throw"===r.method))return h;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=u(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,h;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,h):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function D(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(s&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](r,r.exports,__webpack_require__),r.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={};(()=>{"use strict";var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(757),_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;tVolt Laravel Dashboard - -
    -
    -
    -
    -
    -
    Sales Value
    -

    $10,567

    -
    - Yesterday - - 10.57% -
    -
    -
    - Month - Week -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -

    Customers

    -

    345,678

    -
    -
    -
    -
    -

    Customers

    -

    345k

    -
    - - Feb 1 - Apr 1, - - USA - -
    -
    Since last month 22%
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -

    Revenue

    -

    $43,594

    -
    -
    -
    -
    -

    Revenue

    -

    $43,594

    -
    - - Feb 1 - Apr 1, - - GER - -
    -
    Since last month 2%
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -

    Bounce Rate

    -

    50.88%

    -
    -
    -
    -
    -

    Bounce Rate

    -

    50.88%

    -
    - - Feb 1 - Apr 1 - -
    -
    Since last month 4%
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Page visits

    -
    -
    - See all -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Page namePage ViewsPage ValueBounce rate
    - /demo/admin/index.html - - 3,225 - - $20 - -
    - - 42,55% -
    -
    - /demo/admin/forms.html - - 2,987 - - 0 - -
    - - 43,24% -
    -
    - /demo/admin/util.html - - 2,844 - - 294 - -
    - - 32,35% -
    -
    - /demo/admin/validation.html - - 2,050 - - $147 - -
    - - 50,87% -
    -
    - /demo/admin/modals.html - - 1,483 - - $19 - -
    - - 26,12% -
    -
    -
    -
    -
    -
    -
    -
    -

    Team members

    - See all -
    -
    - -
    -
    -
    -
    -
    -
    -

    Progress track

    - See tasks -
    -
    - -
    -
    - -
    -
    -
    -
    -
    Rocket - SaaS Template
    -
    75 %
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    Themesberg - Design System
    -
    60 %
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    Homepage Design in Figma
    -
    45 %
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    Backend for Themesberg v2
    -
    34 %
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    Total orders
    -

    452

    -
    - - 18.2% -
    -
    -
    -
    - - July -
    -
    - - August -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - Global Rank -
    -
    - -
    -
    -
    -
    - - Country Rank -
    -
    - United States - -
    -
    - -
    -
    -
    -
    - - Category Rank -
    -
    - Computers Electronics > Technology - -
    -
    - -
    -
    -
    -
    -
    -
    -
    -

    Acquisition

    -

    Tells you where your visitors originated from, such as search engines, social networks or website referrals.

    -
    -
    -
    - -
    -
    - -

    33.50%

    -
    -
    -
    -
    -
    -
    - -

    9,567

    -
    -
    -
    -
    -
    -
    -
    -
    \ No newline at end of file diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 1b7d95e..fee4a34 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -1,33 +1,42 @@ - - - @if(in_array(request()->route()->getName(), ['dashboard', 'profile', 'profile-example', 'users', 'bootstrap-tables', 'transactions', - 'buttons', - 'forms', 'modals', 'notifications', 'typography', 'upgrade-to-pro'])) - - {{-- Nav --}} - @include('layouts.nav') - {{-- SideNav --}} - @include('layouts.sidenav') -
    - {{-- TopBar --}} - @include('layouts.topbar') - {{ $slot }} - {{-- Footer --}} - @include('layouts.footer') -
    - - @elseif(in_array(request()->route()->getName(), ['register', 'register-example', 'login', 'login-example', - 'forgot-password', 'forgot-password-example', 'reset-password','reset-password-example'])) - - {{ $slot }} - {{-- Footer --}} - @include('layouts.footer2') + @if( + in_array(request()->route()->getName(), [ + 'register', + 'register-example', + 'login', + 'login-example', + 'forgot-password', + 'forgot-password-example', + 'reset-password', + 'reset-password-example' + ]) + ) + + {{ $slot }} + {{-- Footer --}} + @include('layouts.footer2') @elseif(in_array(request()->route()->getName(), ['404', '500', 'lock'])) - {{ $slot }} + {{ $slot }} + @else + {{-- Nav --}} + @include('layouts.nav') + {{-- SideNav --}} + @include('layouts.sidenav') +
    + {{-- TopBar --}} + + + + + {{ $slot }} + {{-- Footer --}} + @include('layouts.footer') +
    @endif + +
    \ No newline at end of file diff --git a/resources/views/layouts/base.blade.php b/resources/views/layouts/base.blade.php index b73d453..6f885bf 100644 --- a/resources/views/layouts/base.blade.php +++ b/resources/views/layouts/base.blade.php @@ -21,6 +21,9 @@ + + + @endif @@ -56,7 +59,6 @@ @livewireStyles - @livewireScripts @@ -132,6 +134,14 @@ function gtag() { dataLayer.push(arguments); } @endif {{ $slot }} + + + + + + +@livewireScripts + diff --git a/resources/views/layouts/footer.blade.php b/resources/views/layouts/footer.blade.php index dd63237..fa49387 100644 --- a/resources/views/layouts/footer.blade.php +++ b/resources/views/layouts/footer.blade.php @@ -1,4 +1,4 @@ -
    +
    • About @@ -67,4 +66,4 @@ class="text-primary fw-normal" href="https://themesberg.com" target="_blank">The
    - \ No newline at end of file + --> \ No newline at end of file diff --git a/resources/views/layouts/footer2.blade.php b/resources/views/layouts/footer2.blade.php index 48f32ca..35cc447 100644 --- a/resources/views/layouts/footer2.blade.php +++ b/resources/views/layouts/footer2.blade.php @@ -1,4 +1,4 @@ -
    +
    • About @@ -67,4 +66,4 @@ class="text-primary fw-normal" href="https://themesberg.com" target="_blank">The
    - \ No newline at end of file + --> \ No newline at end of file diff --git a/resources/views/layouts/sidenav.blade.php b/resources/views/layouts/sidenav.blade.php index 037a636..295d688 100644 --- a/resources/views/layouts/sidenav.blade.php +++ b/resources/views/layouts/sidenav.blade.php @@ -3,11 +3,10 @@
    - Bonnie Green + Bonnie Green
    -

    Hi, Jane

    +

    {{ auth()->user()->first_name ? auth()->user()->first_name . ' ' . auth()->user()->last_name : 'User Name'}}

    @@ -32,12 +31,7 @@
    +
    + {{ auth()->user()->first_name ? auth()->user()->first_name . ' ' . auth()->user()->last_name : 'User Name'}} +
    + + + +
    \ No newline at end of file diff --git a/resources/views/layouts/topbar.blade.php b/resources/views/layouts/topbar.blade.php index 0e10212..0534418 100644 --- a/resources/views/layouts/topbar.blade.php +++ b/resources/views/layouts/topbar.blade.php @@ -2,26 +2,46 @@
    @@ -57,7 +76,6 @@ class="fas fa-arrow-down mx-1">Download
    - Image placeholder
    @@ -76,7 +94,6 @@ class="fas fa-arrow-down mx-1">Download
    - Image placeholder
    @@ -95,7 +112,6 @@ class="fas fa-arrow-down mx-1">Download
    - Image placeholder
    \ No newline at end of file diff --git a/resources/views/livewire/admin.blade.php b/resources/views/livewire/admin.blade.php new file mode 100644 index 0000000..76210ce --- /dev/null +++ b/resources/views/livewire/admin.blade.php @@ -0,0 +1,9 @@ +
    +

    Adminstrator

    +
    + +
    This is Administrator Dashboard
    +
    + +
    +
    \ No newline at end of file diff --git a/resources/views/livewire/auth/designlogin.html b/resources/views/livewire/auth/designlogin.html new file mode 100644 index 0000000..7186ded --- /dev/null +++ b/resources/views/livewire/auth/designlogin.html @@ -0,0 +1,135 @@ + + + + + + Styled Layout with Form + + + + + +
    +
    +
    +
    + + +
    + + Welcome Image +

    Welcome to Our Service

    + + +

    + We are delighted to have you here. Our platform offers a variety of services to help you achieve your goals. Join us today and start your journey! +

    +
    + + +
    +
    +

    Welcome, Please Login....

    + + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + + +
    +
    +
    +
    +
    + + + + diff --git a/resources/views/livewire/auth/login.blade.php b/resources/views/livewire/auth/login.blade.php index 9797a0c..2f135d7 100644 --- a/resources/views/livewire/auth/login.blade.php +++ b/resources/views/livewire/auth/login.blade.php @@ -1,10 +1,231 @@
    Volt Laravel Dashboard - Sign In page - -
    +
    +
    + +
    +
    + +
    +

    login info

    +

    login info

    +
    + + + +
    +

    WELCOME, PLEASE LOGIN...

    +
    +
    + +
    + + + + + + +
    + @error('email') +
    {{$message}}
    + @enderror +
    +
    +
    + +
    + + + + +
    + @error('password') +
    {{ $message }}
    @enderror +
    +
    +
    + + +
    + +
    +
    +
    + +
    +
    + Forgot Password? +
    +
    + +
    + + + +
    @@ -34,12 +255,11 @@ class="icon icon-xs text-gray-600" fill="currentColor" viewBox="0 0 20 20"
    - @error('email')
    {{$message}}
    + @error('email') +
    {{$message}}
    @enderror
    -
    -
    @@ -53,9 +273,9 @@ class="icon icon-xs text-gray-600" fill="currentColor"
    - @error('password')
    {{ $message }}
    @enderror + @error('password') +
    {{ $message }}
    @enderror
    -
    -
    + -->
    \ No newline at end of file diff --git a/resources/views/livewire/dashboard.blade.php b/resources/views/livewire/dashboard.blade.php new file mode 100644 index 0000000..5c250dd --- /dev/null +++ b/resources/views/livewire/dashboard.blade.php @@ -0,0 +1,121 @@ +Dashboard + +
    + + + +
    + +
    + +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + @foreach($reports as $report) + + + + + + + + + + + + + + + + + + + + + + + @endforeach + +
    Item NameItem CodeGeneric Item NameItem CategoryDepartmentMachineTest CodeTest NameSupplier NameAddressManufactureHSN CodeUnit of PurchasePack SizeTestUnit PriceCGSTSGSTPrice (GST)Action
    {{ $report->item_name }}{{ $report->item_code }}{{ $report->generic_item_name }}{{ $report->item_category }}{{ $report->department }}{{ $report->machine }}{{ $report->test_code }}{{ $report->test_name }}{{ $report->supplier_name }}{{ $report->address }}{{ $report->manufacture }}{{ $report->hsn_code }}{{ $report->unit_of_purchase }}{{ $report->pack_size }}{{ $report->test }}{{ $report->unit_price }}{{ $report->cgst }}{{ $report->sgst }}{{ $report->price_gst }} + Edit + Delete +
    +
    + + + @if($confirmingDelete) +
    +

    Are you sure you want to delete this report?

    + + +
    + @endif +
    +
    +
    +
    + + + diff --git a/resources/views/livewire/edit-report.blade.php b/resources/views/livewire/edit-report.blade.php new file mode 100644 index 0000000..6d681a8 --- /dev/null +++ b/resources/views/livewire/edit-report.blade.php @@ -0,0 +1,23 @@ +
    + @if (session()->has("success")) +
    {{ session("success") }}
    + @endif +
    +
    +
    + @foreach(['item_category', 'generic_item_name', 'item_name', 'item_code', 'department', 'machine', 'test_code', 'test_name', 'supplier_name', 'address', 'manufacture', 'hsn_code', 'unit_of_perchase', 'pack_size', 'test', 'unit_price', 'cgst', 'sgst', 'price_gst'] as $field) +
    + +
    + +
    +
    + @endforeach +
    +
    + +
    +
    +
    +
    diff --git a/resources/views/livewire/logout.blade.php b/resources/views/livewire/logout.blade.php index 317d390..7c617f6 100644 --- a/resources/views/livewire/logout.blade.php +++ b/resources/views/livewire/logout.blade.php @@ -1,3 +1,3 @@ -
    +
    Logout
    \ No newline at end of file diff --git a/resources/views/livewire/reports.blade.php b/resources/views/livewire/reports.blade.php new file mode 100644 index 0000000..13bd480 --- /dev/null +++ b/resources/views/livewire/reports.blade.php @@ -0,0 +1,194 @@ +
    +@if (session()->has("success")) +
    {{ session("success") }}
    + @endif +
    + + @error('file') {{ $message }} @enderror + +
    + Download Test File +
    +
    + + DATA + +
    + @if (session()->has("vaaa")) +
    {{ session("vaaa") }}
    + @endif +
    +
    + +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    + +
    + +
    + +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    + +
    + +
    + +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    + +
    + +
    + +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    + + +
    + +
    +
    +
    +
    +
    + + diff --git a/resources/views/livewire/search-reports.blade.php b/resources/views/livewire/search-reports.blade.php new file mode 100644 index 0000000..aba659a --- /dev/null +++ b/resources/views/livewire/search-reports.blade.php @@ -0,0 +1,75 @@ +
    + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + @foreach($reports as $report) + + + + + + + + + + + + + + + + + + + + + + + @endforeach + +
    Item NameItem CodeGeneric Item NameItem CategoryDepartmentMachineTest CodeTest NameSupplier NameAddressManufactureHSN CodeUnit of PurchasePack SizeTestUnit PriceCGSTSGSTPrice (GST)Action
    {{ $report->item_name }}{{ $report->item_code }}{{ $report->generic_item_name }}{{ $report->item_category }}{{ $report->department }}{{ $report->machine }}{{ $report->test_code }}{{ $report->test_name }}{{ $report->supplier_name }}{{ $report->address }}{{ $report->manufacture }}{{ $report->hsn_code }}{{ $report->unit_of_purchase }}{{ $report->pack_size }}{{ $report->test }}{{ $report->unit_price }}{{ $report->cgst }}{{ $report->sgst }}{{ $report->price_gst }} + +
    +
    +
    +
    + +
    +

    Company

    +
    + +
    +

    Team

    +
    +
    +
    diff --git a/resources/views/livewire/user.blade.php b/resources/views/livewire/user.blade.php new file mode 100644 index 0000000..644f07a --- /dev/null +++ b/resources/views/livewire/user.blade.php @@ -0,0 +1 @@ +
    dddddddddddd
    \ No newline at end of file diff --git a/resources/views/livewire/users.blade.php b/resources/views/livewire/users.blade.php index 2d724b7..18ba98c 100644 --- a/resources/views/livewire/users.blade.php +++ b/resources/views/livewire/users.blade.php @@ -157,7 +157,7 @@ class="icon icon-xxs ms-auto" fill="currentColor" viewBox="0 0 20 20" alt="Avatar">
    Admin -
    admin@volt.com
    +
    admin@gmail.com
    diff --git a/routes/web.php b/routes/web.php index f8c22fa..886c5f4 100644 --- a/routes/web.php +++ b/routes/web.php @@ -25,6 +25,10 @@ use App\Http\Livewire\ResetPasswordExample; use App\Http\Livewire\UpgradeToPro; use App\Http\Livewire\Users; +use App\Http\Livewire\Reports; +use App\Http\Livewire\EditReport; +use App\Http\Controllers\AdminController; +use App\Http\Controllers\StudentController; /* |-------------------------------------------------------------------------- @@ -51,7 +55,16 @@ Route::get('/500', Err500::class)->name('500'); Route::get('/upgrade-to-pro', UpgradeToPro::class)->name('upgrade-to-pro'); +Route::middleware('admin')->group(function () { + Route::get('/admin', [AdminController::class, 'index'])->name('admin'); +}); + +Route::middleware('student')->group(function () { + Route::get('/user', [StudentController::class, 'index'])->name('user'); +}); + Route::middleware('auth')->group(function () { + Route::get('/profile', Profile::class)->name('profile'); Route::get('/profile-example', ProfileExample::class)->name('profile-example'); Route::get('/users', Users::class)->name('users'); @@ -61,6 +74,9 @@ Route::get('/reset-password-example', ResetPasswordExample::class)->name('reset-password-example'); Route::get('/dashboard', Dashboard::class)->name('dashboard'); Route::get('/transactions', Transactions::class)->name('transactions'); + Route::get('/reports', Reports::class)->name('reports'); + Route::get('/reports/edit/{id}', [EditReport::class, 'edit'])->name('reports.edit'); + Route::get('/download-test-file', [Reports::class, 'download'])->name('download.testfile'); Route::get('/bootstrap-tables', BootstrapTables::class)->name('bootstrap-tables'); Route::get('/lock', Lock::class)->name('lock'); Route::get('/buttons', Buttons::class)->name('buttons'); @@ -68,4 +84,5 @@ Route::get('/forms', Forms::class)->name('forms'); Route::get('/modals', Modals::class)->name('modals'); Route::get('/typography', Typography::class)->name('typography'); + });