Skip to content

Commit

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

namespace App\Http\Controllers;

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

class StatusController 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\Status $status
* @return \Illuminate\Http\Response
*/
public function show(Status $status)
{
//
}

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

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

/**
* Remove the specified resource from storage.
*
* @param \App\Models\Status $status
* @return \Illuminate\Http\Response
*/
public function destroy(Status $status)
{
//
}
}
11 changes: 11 additions & 0 deletions app/Models/Status.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 Status extends Model
{
use HasFactory;
}
35 changes: 35 additions & 0 deletions database/migrations/2024_10_04_185751_create_statuses_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

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

class CreateStatusesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('statuses', function (Blueprint $table) {
$table->id();
$table->string('status_name', 255);
$table->string('status_details', 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('statuses');
}
}

0 comments on commit 5fa431d

Please sign in to comment.