Skip to content

Commit

Permalink
Permissions Table added with controller and models
Browse files Browse the repository at this point in the history
  • Loading branch information
meowfu0 committed Oct 4, 2024
1 parent 5fa431d commit fc65649
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 0 deletions.
85 changes: 85 additions & 0 deletions app/Http/Controllers/PermissionController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?php

namespace App\Http\Controllers;

use App\Models\Permission;
use Illuminate\Http\Request;

class PermissionController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}

/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}

/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
}

/**
* Display the specified resource.
*
* @param \App\Models\Permission $permission
* @return \Illuminate\Http\Response
*/
public function show(Permission $permission)
{
//
}

/**
* Show the form for editing the specified resource.
*
* @param \App\Models\Permission $permission
* @return \Illuminate\Http\Response
*/
public function edit(Permission $permission)
{
//
}

/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\Permission $permission
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Permission $permission)
{
//
}

/**
* Remove the specified resource from storage.
*
* @param \App\Models\Permission $permission
* @return \Illuminate\Http\Response
*/
public function destroy(Permission $permission)
{
//
}
}
11 changes: 11 additions & 0 deletions app/Models/Permission.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Permission extends Model
{
use HasFactory;
}
34 changes: 34 additions & 0 deletions database/migrations/2024_10_04_191346_create_permissions_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePermissionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('permissions', function (Blueprint $table) {
$table->id();
$table->string('permission_name', 255);
$table->timestamp('created_at')->useCurrent();
$table->timestamp('modified_at')->nullable()->useCurrentOnUpdate();
$table->timestamp('deleted_at')->nullable();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('permissions');
}
}

0 comments on commit fc65649

Please sign in to comment.