Skip to content

Commit 01415fb

Browse files
committed
Initial Module
1 parent 01b3506 commit 01415fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+787
-23
lines changed

.gitignore

+1-23
Original file line numberDiff line numberDiff line change
@@ -1,23 +1 @@
1-
/vendor/
2-
node_modules/
3-
npm-debug.log
4-
yarn-error.log
5-
6-
# Laravel 4 specific
7-
bootstrap/compiled.php
8-
app/storage/
9-
10-
# Laravel 5 & Lumen specific
11-
public/storage
12-
public/hot
13-
14-
# Laravel 5 & Lumen specific with changed public path
15-
public_html/storage
16-
public_html/hot
17-
18-
storage/*.key
19-
.env
20-
Homestead.yaml
21-
Homestead.json
22-
/.vagrant
23-
.phpunit.result.cache
1+
.idea/

.idea/.gitignore

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/ModuleManager.iml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Config/.gitkeep

Whitespace-only changes.

Config/config.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
return [
4+
'name' => 'ModuleManager'
5+
];

Console/.gitkeep

Whitespace-only changes.

Database/Migrations/.gitkeep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
class CreateMModulesTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::create('m_modules', function (Blueprint $table) {
17+
$table->id();
18+
19+
$table->timestamps();
20+
});
21+
}
22+
23+
/**
24+
* Reverse the migrations.
25+
*
26+
* @return void
27+
*/
28+
public function down()
29+
{
30+
Schema::dropIfExists('m_modules');
31+
}
32+
}

Database/Seeders/.gitkeep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace Modules\ModuleManager\Database\Seeders;
4+
5+
use Illuminate\Database\Seeder;
6+
use Illuminate\Database\Eloquent\Model;
7+
8+
class ModuleManagerDatabaseSeeder extends Seeder
9+
{
10+
/**
11+
* Run the database seeds.
12+
*
13+
* @return void
14+
*/
15+
public function run()
16+
{
17+
Model::unguard();
18+
19+
// $this->call("OthersTableSeeder");
20+
}
21+
}

Database/factories/.gitkeep

Whitespace-only changes.

Entities/.gitkeep

Whitespace-only changes.

Entities/MModule.php

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace Modules\ModuleManager\Entities;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
use Illuminate\Database\Eloquent\Factories\HasFactory;
7+
8+
class MModule extends Model
9+
{
10+
use HasFactory;
11+
12+
protected $fillable = [];
13+
14+
protected static function newFactory()
15+
{
16+
return \Modules\ModuleManager\Database\factories\MModuleFactory::new();
17+
}
18+
}

Events/ModuleCreated.php

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
3+
/**
4+
* Putting this here to help remind you where this came from.
5+
*
6+
* I'll get back to improving this and adding more as time permits
7+
* if you need some help feel free to drop me a line.
8+
*
9+
* * Twenty-Years Experience
10+
* * PHP, JavaScript, Laravel, MySQL, Java, Python and so many more!
11+
*
12+
*
13+
* @author Simple-Pleb <[email protected]>
14+
* @website https://www.simple-pleb.com
15+
* @source https://github.com/simplepleb/article-module
16+
*
17+
* @license Free to do as you please
18+
*
19+
* @since 1.0
20+
*
21+
*/
22+
23+
namespace Modules\ModuleManager\Events;
24+
25+
use Illuminate\Queue\SerializesModels;
26+
use Modules\ModuleManager\Entities\MModule;
27+
28+
class ModuleCreated
29+
{
30+
use SerializesModels;
31+
32+
public $mmodule;
33+
34+
/**
35+
* Create a new event instance.
36+
*
37+
* @param MModule $mmodule
38+
*/
39+
public function __construct(MModule $mmodule)
40+
{
41+
$this->mmodule = $mmodule;
42+
}
43+
44+
/**
45+
* Get the channels the event should be broadcast on.
46+
*
47+
* @return array
48+
*/
49+
public function broadcastOn()
50+
{
51+
return [];
52+
}
53+
}

Events/ModuleUpdated.php

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
3+
/**
4+
* Putting this here to help remind you where this came from.
5+
*
6+
* I'll get back to improving this and adding more as time permits
7+
* if you need some help feel free to drop me a line.
8+
*
9+
* * Twenty-Years Experience
10+
* * PHP, JavaScript, Laravel, MySQL, Java, Python and so many more!
11+
*
12+
*
13+
* @author Simple-Pleb <[email protected]>
14+
* @website https://www.simple-pleb.com
15+
* @source https://github.com/simplepleb/article-module
16+
*
17+
* @license Free to do as you please
18+
*
19+
* @since 1.0
20+
*
21+
*/
22+
23+
namespace Modules\ModuleManager\Events;
24+
25+
use Illuminate\Queue\SerializesModels;
26+
use Modules\ModuleManager\Entities\MModule;
27+
28+
class ModuleUpdated
29+
{
30+
use SerializesModels;
31+
32+
public $mmodule;
33+
34+
/**
35+
* Create a new event instance.
36+
*
37+
* @return void
38+
*/
39+
public function __construct(MModule $mmodule)
40+
{
41+
$this->mmodule = $mmodule;
42+
}
43+
44+
/**
45+
* Get the channels the event should be broadcast on.
46+
*
47+
* @return array
48+
*/
49+
public function broadcastOn()
50+
{
51+
return [];
52+
}
53+
}

Http/Controllers/.gitkeep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?php
2+
3+
namespace Modules\ModuleManager\Http\Controllers;
4+
5+
use Illuminate\Contracts\Support\Renderable;
6+
use Illuminate\Http\Request;
7+
use Illuminate\Routing\Controller;
8+
9+
class ModuleManagerController extends Controller
10+
{
11+
/**
12+
* Display a listing of the resource.
13+
* @return Renderable
14+
*/
15+
public function index()
16+
{
17+
return view('modulemanager::index');
18+
}
19+
20+
/**
21+
* Show the form for creating a new resource.
22+
* @return Renderable
23+
*/
24+
public function create()
25+
{
26+
return view('modulemanager::create');
27+
}
28+
29+
/**
30+
* Store a newly created resource in storage.
31+
* @param Request $request
32+
* @return Renderable
33+
*/
34+
public function store(Request $request)
35+
{
36+
//
37+
}
38+
39+
/**
40+
* Show the specified resource.
41+
* @param int $id
42+
* @return Renderable
43+
*/
44+
public function show($id)
45+
{
46+
return view('modulemanager::show');
47+
}
48+
49+
/**
50+
* Show the form for editing the specified resource.
51+
* @param int $id
52+
* @return Renderable
53+
*/
54+
public function edit($id)
55+
{
56+
return view('modulemanager::edit');
57+
}
58+
59+
/**
60+
* Update the specified resource in storage.
61+
* @param Request $request
62+
* @param int $id
63+
* @return Renderable
64+
*/
65+
public function update(Request $request, $id)
66+
{
67+
//
68+
}
69+
70+
/**
71+
* Remove the specified resource from storage.
72+
* @param int $id
73+
* @return Renderable
74+
*/
75+
public function destroy($id)
76+
{
77+
//
78+
}
79+
}

Http/Middleware/.gitkeep

Whitespace-only changes.

Http/Requests/.gitkeep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
3+
/**
4+
* Putting this here to help remind you where this came from.
5+
*
6+
* I'll get back to improving this and adding more as time permits
7+
* if you need some help feel free to drop me a line.
8+
*
9+
* * Twenty-Years Experience
10+
* * PHP, JavaScript, Laravel, MySQL, Java, Python and so many more!
11+
*
12+
*
13+
* @author Simple-Pleb <[email protected]>
14+
* @website https://www.simple-pleb.com
15+
* @source https://github.com/simplepleb/article-module
16+
*
17+
* @license Free to do as you please
18+
*
19+
* @since 1.0
20+
*
21+
*/
22+
23+
namespace Modules\ModuleManager\Listeners\PostCreated;
24+
25+
use Illuminate\Contracts\Queue\ShouldQueue;
26+
use Log;
27+
use Modules\ModuleManager\Events\ModuleCreated;
28+
29+
30+
class CreateModuleData implements ShouldQueue
31+
{
32+
/**
33+
* Create the event listener.
34+
*
35+
* @return void
36+
*/
37+
public function __construct()
38+
{
39+
//
40+
}
41+
42+
/**
43+
* Handle the event.
44+
*
45+
* @param object $event
46+
*
47+
* @return void
48+
*/
49+
public function handle(ModuleCreated $event)
50+
{
51+
$post = $event->post;
52+
53+
Log::debug('Listeners: CreateModuleData');
54+
}
55+
}

0 commit comments

Comments
 (0)