Skip to content

Commit

Permalink
Merge pull request #60 from Crudzaso/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
DiegoAndresRamirez authored Nov 11, 2024
2 parents 597f5f2 + 534af02 commit 706de5a
Show file tree
Hide file tree
Showing 50 changed files with 271 additions and 281 deletions.
10 changes: 5 additions & 5 deletions Modules/Draws/app/Models/Draws.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lotery\Models\Lotery;
use Modules\Lottery\Models\Lottery;

class Draws extends Model
{
Expand All @@ -22,8 +22,8 @@ class Draws extends Model
/**
* Get the lottery associated with the draw.
*/
public function lottery()
{
return $this->belongsTo(Lotery::class);
}
public function lottery()
{
return $this->belongsTo(Lottery::class, 'lottery_id');
}
}
62 changes: 0 additions & 62 deletions Modules/Lotery/app/Http/Controllers/LoteryController.php

This file was deleted.

33 changes: 0 additions & 33 deletions Modules/Lotery/app/Models/Lotery.php

This file was deleted.

5 changes: 0 additions & 5 deletions Modules/Lotery/config/config.php

This file was deleted.

11 changes: 0 additions & 11 deletions Modules/Lotery/module.json

This file was deleted.

1 change: 0 additions & 1 deletion Modules/Lotery/resources/assets/js/app.js

This file was deleted.

23 changes: 0 additions & 23 deletions Modules/Lotery/resources/views/create.blade.php

This file was deleted.

24 changes: 0 additions & 24 deletions Modules/Lotery/resources/views/edit.blade.php

This file was deleted.

46 changes: 0 additions & 46 deletions Modules/Lotery/resources/views/index.blade.php

This file was deleted.

24 changes: 0 additions & 24 deletions Modules/Lotery/routes/web.php

This file was deleted.

66 changes: 66 additions & 0 deletions Modules/Lottery/app/Http/Controllers/LotteryController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php

namespace Modules\Lottery\Http\Controllers;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Modules\Lottery\Models\Lottery;

class LotteryController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
return response()->json(Lottery::all());
}

/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('lottery::create');
}

/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}

/**
* Show the specified resource.
*/
public function show($id)
{
return view('lottery::show');
}

/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
return view('lottery::edit');
}

/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id)
{
//
}

/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
//
}
}
39 changes: 39 additions & 0 deletions Modules/Lottery/app/Models/Lottery.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

namespace Modules\Lottery\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
// use Modules\Lottery\Database\Factories\LotteryFactory;
use Modules\Raffle\Models\Raffle;
use Modules\Draws\Models\Draws;

class Lottery extends Model
{
use HasFactory;

public function raffles()
{
return $this->hasMany(Raffle::class, 'lottery_id');
}

public function draws()
{
return $this->hasMany(Draws::class, 'lottery_id');
}

/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'name',
'description',
'url_imagen'
];

protected static function newFactory()
{
return \Modules\Lottery\Database\Factories\LotteryFactory::new();
}
}

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Modules\Lotery\Providers;
namespace Modules\Lottery\Providers;

use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?php

namespace Modules\Lotery\Providers;
namespace Modules\Lottery\Providers;

use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
use Nwidart\Modules\Traits\PathNamespace;

class LoteryServiceProvider extends ServiceProvider
class LotteryServiceProvider extends ServiceProvider
{
use PathNamespace;

protected string $name = 'Lotery';
protected string $name = 'Lottery';

protected string $nameLower = 'lotery';
protected string $nameLower = 'lottery';

/**
* Boot the application events.
Expand Down
Loading

0 comments on commit 706de5a

Please sign in to comment.