Initial commit for DailySalePaymentReportModule

This commit is contained in:
2026-07-03 10:03:00 +05:30
commit 79aaecfcf0
31 changed files with 419 additions and 0 deletions

0
Config/.gitkeep Normal file
View File

5
Config/config.php Normal file
View File

@@ -0,0 +1,5 @@
<?php
return [
'name' => 'DailySalePaymentReportModule'
];

0
Console/.gitkeep Normal file
View File

View File

View File

View File

@@ -0,0 +1,21 @@
<?php
namespace Modules\DailySalePaymentReportModule\Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class DailySalePaymentReportModuleDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
// $this->call("OthersTableSeeder");
}
}

View File

0
Entities/.gitkeep Normal file
View File

View File

View File

@@ -0,0 +1,79 @@
<?php
namespace Modules\DailySalePaymentReportModule\Http\Controllers;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
class DailySalePaymentReportModuleController extends Controller
{
/**
* Display a listing of the resource.
* @return Renderable
*/
public function index()
{
return view('dailysalepaymentreportmodule::index');
}
/**
* Show the form for creating a new resource.
* @return Renderable
*/
public function create()
{
return view('dailysalepaymentreportmodule::create');
}
/**
* Store a newly created resource in storage.
* @param Request $request
* @return Renderable
*/
public function store(Request $request)
{
//
}
/**
* Show the specified resource.
* @param int $id
* @return Renderable
*/
public function show($id)
{
return view('dailysalepaymentreportmodule::show');
}
/**
* Show the form for editing the specified resource.
* @param int $id
* @return Renderable
*/
public function edit($id)
{
return view('dailysalepaymentreportmodule::edit');
}
/**
* Update the specified resource in storage.
* @param Request $request
* @param int $id
* @return Renderable
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
* @param int $id
* @return Renderable
*/
public function destroy($id)
{
//
}
}

0
Http/Middleware/.gitkeep Normal file
View File

0
Http/Requests/.gitkeep Normal file
View File

0
Providers/.gitkeep Normal file
View File

View File

@@ -0,0 +1,112 @@
<?php
namespace Modules\DailySalePaymentReportModule\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Factory;
class DailySalePaymentReportModuleServiceProvider extends ServiceProvider
{
/**
* @var string $moduleName
*/
protected $moduleName = 'DailySalePaymentReportModule';
/**
* @var string $moduleNameLower
*/
protected $moduleNameLower = 'dailysalepaymentreportmodule';
/**
* Boot the application events.
*
* @return void
*/
public function boot()
{
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations'));
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->register(RouteServiceProvider::class);
}
/**
* Register config.
*
* @return void
*/
protected function registerConfig()
{
$this->publishes([
module_path($this->moduleName, 'Config/config.php') => config_path($this->moduleNameLower . '.php'),
], 'config');
$this->mergeConfigFrom(
module_path($this->moduleName, 'Config/config.php'), $this->moduleNameLower
);
}
/**
* Register views.
*
* @return void
*/
public function registerViews()
{
$viewPath = resource_path('views/modules/' . $this->moduleNameLower);
$sourcePath = module_path($this->moduleName, 'Resources/views');
$this->publishes([
$sourcePath => $viewPath
], ['views', $this->moduleNameLower . '-module-views']);
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
}
/**
* Register translations.
*
* @return void
*/
public function registerTranslations()
{
$langPath = resource_path('lang/modules/' . $this->moduleNameLower);
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
} else {
$this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower);
}
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return [];
}
private function getPublishableViewPaths(): array
{
$paths = [];
foreach (\Config::get('view.paths') as $path) {
if (is_dir($path . '/modules/' . $this->moduleNameLower)) {
$paths[] = $path . '/modules/' . $this->moduleNameLower;
}
}
return $paths;
}
}

View File

@@ -0,0 +1,69 @@
<?php
namespace Modules\DailySalePaymentReportModule\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* The module namespace to assume when generating URLs to actions.
*
* @var string
*/
protected $moduleNamespace = 'Modules\DailySalePaymentReportModule\Http\Controllers';
/**
* Called before routes are registered.
*
* Register any model bindings or pattern based filters.
*
* @return void
*/
public function boot()
{
parent::boot();
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->mapApiRoutes();
$this->mapWebRoutes();
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->moduleNamespace)
->group(module_path('DailySalePaymentReportModule', '/Routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->moduleNamespace)
->group(module_path('DailySalePaymentReportModule', '/Routes/api.php'));
}
}

View File

View File

View File

0
Resources/lang/.gitkeep Normal file
View File

0
Resources/views/.gitkeep Normal file
View File

View File

@@ -0,0 +1,9 @@
@extends('dailysalepaymentreportmodule::layouts.master')
@section('content')
<h1>Hello World</h1>
<p>
This view is loaded from module: {!! config('dailysalepaymentreportmodule.name') !!}
</p>
@endsection

View File

@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Module DailySalePaymentReportModule</title>
{{-- Laravel Mix - CSS File --}}
{{-- <link rel="stylesheet" href="{{ mix('css/dailysalepaymentreportmodule.css') }}"> --}}
</head>
<body>
@yield('content')
{{-- Laravel Mix - JS File --}}
{{-- <script src="{{ mix('js/dailysalepaymentreportmodule.js') }}"></script> --}}
</body>
</html>

0
Routes/.gitkeep Normal file
View File

18
Routes/api.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::middleware('auth:api')->get('/dailysalepaymentreportmodule', function (Request $request) {
return $request->user();
});

16
Routes/web.php Normal file
View File

@@ -0,0 +1,16 @@
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::prefix('dailysalepaymentreportmodule')->group(function() {
Route::get('/', 'DailySalePaymentReportModuleController@index');
});

0
Tests/Feature/.gitkeep Normal file
View File

0
Tests/Unit/.gitkeep Normal file
View File

23
composer.json Normal file
View File

@@ -0,0 +1,23 @@
{
"name": "nwidart/dailysalepaymentreportmodule",
"description": "",
"authors": [
{
"name": "Nicolas Widart",
"email": "n.widart@gmail.com"
}
],
"extra": {
"laravel": {
"providers": [],
"aliases": {
}
}
},
"autoload": {
"psr-4": {
"Modules\\DailySalePaymentReportModule\\": ""
}
}
}

13
module.json Normal file
View File

@@ -0,0 +1,13 @@
{
"name": "DailySalePaymentReportModule",
"alias": "dailysalepaymentreportmodule",
"description": "",
"keywords": [],
"priority": 0,
"providers": [
"Modules\\DailySalePaymentReportModule\\Providers\\DailySalePaymentReportModuleServiceProvider"
],
"aliases": {},
"files": [],
"requires": []
}

21
package.json Normal file
View File

@@ -0,0 +1,21 @@
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
},
"devDependencies": {
"axios": "^0.21.4",
"dotenv": "^10.0.0",
"dotenv-expand": "^5.1.0",
"laravel-mix": "^6.0.31",
"laravel-mix-merge-manifest": "^2.0.0",
"lodash": "^4.17.21",
"postcss": "^8.3.7"
}
}

14
webpack.mix.js Normal file
View File

@@ -0,0 +1,14 @@
const dotenvExpand = require('dotenv-expand');
dotenvExpand(require('dotenv').config({ path: '../../.env'/*, debug: true*/}));
const mix = require('laravel-mix');
require('laravel-mix-merge-manifest');
mix.setPublicPath('../../public').mergeManifest();
mix.js(__dirname + '/Resources/assets/js/app.js', 'js/dailysalepaymentreportmodule.js')
.sass( __dirname + '/Resources/assets/sass/app.scss', 'css/dailysalepaymentreportmodule.css');
if (mix.inProduction()) {
mix.version();
}