Skip to content

Commit e4c8490

Browse files
committed
Run Make User Model with -a
1 parent 0215ed2 commit e4c8490

File tree

7 files changed

+230
-0
lines changed

7 files changed

+230
-0
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use App\Http\Requests\StoreUserRequest;
6+
use App\Http\Requests\UpdateUserRequest;
7+
use App\Models\User;
8+
9+
class UserController extends Controller
10+
{
11+
/**
12+
* Display a listing of the resource.
13+
*
14+
* @return \Illuminate\Http\Response
15+
*/
16+
public function index()
17+
{
18+
//
19+
}
20+
21+
/**
22+
* Show the form for creating a new resource.
23+
*
24+
* @return \Illuminate\Http\Response
25+
*/
26+
public function create()
27+
{
28+
//
29+
}
30+
31+
/**
32+
* Store a newly created resource in storage.
33+
*
34+
* @param \App\Http\Requests\StoreUserRequest $request
35+
* @return \Illuminate\Http\Response
36+
*/
37+
public function store(StoreUserRequest $request)
38+
{
39+
//
40+
}
41+
42+
/**
43+
* Display the specified resource.
44+
*
45+
* @param \App\Models\User $user
46+
* @return \Illuminate\Http\Response
47+
*/
48+
public function show(User $user)
49+
{
50+
//
51+
}
52+
53+
/**
54+
* Show the form for editing the specified resource.
55+
*
56+
* @param \App\Models\User $user
57+
* @return \Illuminate\Http\Response
58+
*/
59+
public function edit(User $user)
60+
{
61+
//
62+
}
63+
64+
/**
65+
* Update the specified resource in storage.
66+
*
67+
* @param \App\Http\Requests\UpdateUserRequest $request
68+
* @param \App\Models\User $user
69+
* @return \Illuminate\Http\Response
70+
*/
71+
public function update(UpdateUserRequest $request, User $user)
72+
{
73+
//
74+
}
75+
76+
/**
77+
* Remove the specified resource from storage.
78+
*
79+
* @param \App\Models\User $user
80+
* @return \Illuminate\Http\Response
81+
*/
82+
public function destroy(User $user)
83+
{
84+
//
85+
}
86+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace App\Http\Requests;
4+
5+
use Illuminate\Foundation\Http\FormRequest;
6+
7+
class StoreUserRequest extends FormRequest
8+
{
9+
/**
10+
* Determine if the user is authorized to make this request.
11+
*
12+
* @return bool
13+
*/
14+
public function authorize()
15+
{
16+
return false;
17+
}
18+
19+
/**
20+
* Get the validation rules that apply to the request.
21+
*
22+
* @return array<string, mixed>
23+
*/
24+
public function rules()
25+
{
26+
return [
27+
//
28+
];
29+
}
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace App\Http\Requests;
4+
5+
use Illuminate\Foundation\Http\FormRequest;
6+
7+
class UpdateUserRequest extends FormRequest
8+
{
9+
/**
10+
* Determine if the user is authorized to make this request.
11+
*
12+
* @return bool
13+
*/
14+
public function authorize()
15+
{
16+
return false;
17+
}
18+
19+
/**
20+
* Get the validation rules that apply to the request.
21+
*
22+
* @return array<string, mixed>
23+
*/
24+
public function rules()
25+
{
26+
return [
27+
//
28+
];
29+
}
30+
}

app/Models/User.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace App\Models;
4+
5+
use Illuminate\Database\Eloquent\Factories\HasFactory;
6+
use Illuminate\Database\Eloquent\Model;
7+
8+
class User extends Model
9+
{
10+
use HasFactory;
11+
}

database/factories/UserFactory.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace Database\Factories;
4+
5+
use Illuminate\Database\Eloquent\Factories\Factory;
6+
7+
/**
8+
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
9+
*/
10+
class UserFactory extends Factory
11+
{
12+
/**
13+
* Define the model's default state.
14+
*
15+
* @return array<string, mixed>
16+
*/
17+
public function definition()
18+
{
19+
return [
20+
//
21+
];
22+
}
23+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::create('users', function (Blueprint $table) {
17+
$table->id();
18+
$table->timestamps();
19+
});
20+
}
21+
22+
/**
23+
* Reverse the migrations.
24+
*
25+
* @return void
26+
*/
27+
public function down()
28+
{
29+
Schema::dropIfExists('users');
30+
}
31+
};

database/seeders/UserSeeder.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace Database\Seeders;
4+
5+
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
6+
use Illuminate\Database\Seeder;
7+
8+
class UserSeeder extends Seeder
9+
{
10+
/**
11+
* Run the database seeds.
12+
*
13+
* @return void
14+
*/
15+
public function run()
16+
{
17+
//
18+
}
19+
}

0 commit comments

Comments
 (0)