-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from Crudzaso/develop
pr develop to main
- Loading branch information
Showing
282 changed files
with
5,552 additions
and
13 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
namespace Modules\Draws\Http\Controllers; | ||
|
||
use App\Http\Controllers\Controller; | ||
use Illuminate\Http\Request; | ||
|
||
class DrawsController extends Controller | ||
{ | ||
/** | ||
* Display a listing of the resource. | ||
*/ | ||
public function index() | ||
{ | ||
return view('draws::index'); | ||
} | ||
|
||
/** | ||
* Show the form for creating a new resource. | ||
*/ | ||
public function create() | ||
{ | ||
return view('draws::create'); | ||
} | ||
|
||
/** | ||
* Store a newly created resource in storage. | ||
*/ | ||
public function store(Request $request) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Show the specified resource. | ||
*/ | ||
public function show($id) | ||
{ | ||
return view('draws::show'); | ||
} | ||
|
||
/** | ||
* Show the form for editing the specified resource. | ||
*/ | ||
public function edit($id) | ||
{ | ||
return view('draws::edit'); | ||
} | ||
|
||
/** | ||
* Update the specified resource in storage. | ||
*/ | ||
public function update(Request $request, $id) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Remove the specified resource from storage. | ||
*/ | ||
public function destroy($id) | ||
{ | ||
// | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Modules\Draws\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
// use Modules\Draws\Database\Factories\DrawsFactory; | ||
|
||
class Draws extends Model | ||
{ | ||
use HasFactory; | ||
|
||
/** | ||
* The attributes that are mass assignable. | ||
*/ | ||
protected $fillable = []; | ||
|
||
// protected static function newFactory(): DrawsFactory | ||
// { | ||
// // return DrawsFactory::new(); | ||
// } | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
<?php | ||
|
||
namespace Modules\Draws\Providers; | ||
|
||
use Illuminate\Support\Facades\Blade; | ||
use Illuminate\Support\ServiceProvider; | ||
use Nwidart\Modules\Traits\PathNamespace; | ||
|
||
class DrawsServiceProvider extends ServiceProvider | ||
{ | ||
use PathNamespace; | ||
|
||
protected string $name = 'Draws'; | ||
|
||
protected string $nameLower = 'draws'; | ||
|
||
/** | ||
* Boot the application events. | ||
*/ | ||
public function boot(): void | ||
{ | ||
$this->registerCommands(); | ||
$this->registerCommandSchedules(); | ||
$this->registerTranslations(); | ||
$this->registerConfig(); | ||
$this->registerViews(); | ||
$this->loadMigrationsFrom(module_path($this->name, 'database/migrations')); | ||
} | ||
|
||
/** | ||
* Register the service provider. | ||
*/ | ||
public function register(): void | ||
{ | ||
$this->app->register(EventServiceProvider::class); | ||
$this->app->register(RouteServiceProvider::class); | ||
} | ||
|
||
/** | ||
* Register commands in the format of Command::class | ||
*/ | ||
protected function registerCommands(): void | ||
{ | ||
// $this->commands([]); | ||
} | ||
|
||
/** | ||
* Register command Schedules. | ||
*/ | ||
protected function registerCommandSchedules(): void | ||
{ | ||
// $this->app->booted(function () { | ||
// $schedule = $this->app->make(Schedule::class); | ||
// $schedule->command('inspire')->hourly(); | ||
// }); | ||
} | ||
|
||
/** | ||
* Register translations. | ||
*/ | ||
public function registerTranslations(): void | ||
{ | ||
$langPath = resource_path('lang/modules/'.$this->nameLower); | ||
|
||
if (is_dir($langPath)) { | ||
$this->loadTranslationsFrom($langPath, $this->nameLower); | ||
$this->loadJsonTranslationsFrom($langPath); | ||
} else { | ||
$this->loadTranslationsFrom(module_path($this->name, 'lang'), $this->nameLower); | ||
$this->loadJsonTranslationsFrom(module_path($this->name, 'lang')); | ||
} | ||
} | ||
|
||
/** | ||
* Register config. | ||
*/ | ||
protected function registerConfig(): void | ||
{ | ||
$this->publishes([module_path($this->name, 'config/config.php') => config_path($this->nameLower.'.php')], 'config'); | ||
$this->mergeConfigFrom(module_path($this->name, 'config/config.php'), $this->nameLower); | ||
} | ||
|
||
/** | ||
* Register views. | ||
*/ | ||
public function registerViews(): void | ||
{ | ||
$viewPath = resource_path('views/modules/'.$this->nameLower); | ||
$sourcePath = module_path($this->name, 'resources/views'); | ||
|
||
$this->publishes([$sourcePath => $viewPath], ['views', $this->nameLower.'-module-views']); | ||
|
||
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->nameLower); | ||
|
||
$componentNamespace = $this->module_namespace($this->name, $this->app_path(config('modules.paths.generator.component-class.path'))); | ||
Blade::componentNamespace($componentNamespace, $this->nameLower); | ||
} | ||
|
||
/** | ||
* Get the services provided by the provider. | ||
*/ | ||
public function provides(): array | ||
{ | ||
return []; | ||
} | ||
|
||
private function getPublishableViewPaths(): array | ||
{ | ||
$paths = []; | ||
foreach (config('view.paths') as $path) { | ||
if (is_dir($path.'/modules/'.$this->nameLower)) { | ||
$paths[] = $path.'/modules/'.$this->nameLower; | ||
} | ||
} | ||
|
||
return $paths; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace Modules\Draws\Providers; | ||
|
||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; | ||
|
||
class EventServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* The event handler mappings for the application. | ||
* | ||
* @var array<string, array<int, string>> | ||
*/ | ||
protected $listen = []; | ||
|
||
/** | ||
* Indicates if events should be discovered. | ||
* | ||
* @var bool | ||
*/ | ||
protected static $shouldDiscoverEvents = true; | ||
|
||
/** | ||
* Configure the proper event listeners for email verification. | ||
*/ | ||
protected function configureEmailVerification(): void | ||
{ | ||
// | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
namespace Modules\Draws\Providers; | ||
|
||
use Illuminate\Support\Facades\Route; | ||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; | ||
|
||
class RouteServiceProvider extends ServiceProvider | ||
{ | ||
protected string $name = 'Draws'; | ||
|
||
/** | ||
* Called before routes are registered. | ||
* | ||
* Register any model bindings or pattern based filters. | ||
*/ | ||
public function boot(): void | ||
{ | ||
parent::boot(); | ||
} | ||
|
||
/** | ||
* Define the routes for the application. | ||
*/ | ||
public function map(): void | ||
{ | ||
$this->mapApiRoutes(); | ||
$this->mapWebRoutes(); | ||
} | ||
|
||
/** | ||
* Define the "web" routes for the application. | ||
* | ||
* These routes all receive session state, CSRF protection, etc. | ||
*/ | ||
protected function mapWebRoutes(): void | ||
{ | ||
Route::middleware('web')->group(module_path($this->name, '/routes/web.php')); | ||
} | ||
|
||
/** | ||
* Define the "api" routes for the application. | ||
* | ||
* These routes are typically stateless. | ||
*/ | ||
protected function mapApiRoutes(): void | ||
{ | ||
Route::middleware('api')->prefix('api')->name('api.')->group(module_path($this->name, '/routes/api.php')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "nwidart/draws", | ||
"description": "", | ||
"authors": [ | ||
{ | ||
"name": "Nicolas Widart", | ||
"email": "n.widart@gmail.com" | ||
} | ||
], | ||
"extra": { | ||
"laravel": { | ||
"providers": [], | ||
"aliases": { | ||
|
||
} | ||
} | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Modules\\Draws\\": "app/", | ||
"Modules\\Draws\\Database\\Factories\\": "database/factories/", | ||
"Modules\\Draws\\Database\\Seeders\\": "database/seeders/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Modules\\Draws\\Tests\\": "tests/" | ||
} | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
return [ | ||
'name' => 'Draws', | ||
]; |
Empty file.
Empty file.
30 changes: 30 additions & 0 deletions
30
Modules/Draws/database/migrations/2024_10_30_233206_create_draws_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::create('draws', function (Blueprint $table) { | ||
$table->id(); | ||
$table->foreignId('lottery_id')->constrained('lotteries'); | ||
$table->dateTime('draw_date'); | ||
$table->string('winning_numbers')->nullable(); | ||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::dropIfExists('draws'); | ||
} | ||
}; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Modules\Draws\Database\Seeders; | ||
|
||
use Illuminate\Database\Seeder; | ||
|
||
class DrawsDatabaseSeeder extends Seeder | ||
{ | ||
/** | ||
* Run the database seeds. | ||
*/ | ||
public function run(): void | ||
{ | ||
// $this->call([]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "Draws", | ||
"alias": "draws", | ||
"description": "", | ||
"keywords": [], | ||
"priority": 0, | ||
"providers": [ | ||
"Modules\\Draws\\Providers\\DrawsServiceProvider" | ||
], | ||
"files": [] | ||
} |
Oops, something went wrong.