BDD: création initiale

This commit is contained in:
Olivier DOSSMANN 2021-04-27 18:55:19 +02:00
parent 3273929ca4
commit 5ad83f8744
5 changed files with 174 additions and 0 deletions

View File

@ -0,0 +1,85 @@
<?php
namespace App\Http\Controllers;
use App\Models\Menu;
use Illuminate\Http\Request;
class MenuController 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\Menu $menu
* @return \Illuminate\Http\Response
*/
public function show(Menu $menu)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Models\Menu $menu
* @return \Illuminate\Http\Response
*/
public function edit(Menu $menu)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\Menu $menu
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Menu $menu)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param \App\Models\Menu $menu
* @return \Illuminate\Http\Response
*/
public function destroy(Menu $menu)
{
//
}
}

11
app/Models/Menu.php Normal file
View File

@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Menu extends Model
{
use HasFactory;
}

View File

@ -0,0 +1,28 @@
<?php
namespace Database\Factories;
use App\Models\Menu;
use Illuminate\Database\Eloquent\Factories\Factory;
class MenuFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Menu::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
//
];
}
}

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateMenusTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('menus', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->string('title');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('menus');
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
class MenuSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
//
}
}