Skip to content

Commit 1ce74c4

Browse files
author
Jonathan
committed
readme changes
1 parent d417348 commit 1ce74c4

File tree

1 file changed

+28
-22
lines changed

1 file changed

+28
-22
lines changed

README.md

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
11
# Crud Generator Laravel 9 and 10 (your time saver)
22

3-
Crud Generator Laravel is a package that you can integrate in your Laravel to create a REAL CRUD :
4-
- **controller** with all the code already written
5-
- **views** (index, create, edit, show)
6-
- **model** with relationships
7-
- **request** file with rules
8-
- **migration** file
3+
Crud Generator Laravel is a package designed to simplify the creation of a complete CRUD system in your Laravel project. It includes:
4+
5+
- **Controller** with all the code already written
6+
- **Views** (index, create, edit, show)
7+
- **Model** with relationships
8+
- **Request** file with validation rules
9+
- **Migration** file
910

1011
And since 1.9.2, a complete **REST API** !
1112

13+
[ NEW ] [Your voice matters! Participate in the polls and vote for future features and improvements](https://github.com/misterdebug/crud-generator-laravel/discussions/categories/polls)
14+
15+
1216
## Installation
1317

14-
1\. Run composer command:
18+
1\. Run the following composer command:
1519

16-
``` composer require mrdebug/crudgen --dev```
20+
``` composer require mrdebug/crudgen --dev ```
1721

1822
2\. If you don't use Laravel Collective Form package in your project, install it:
1923

20-
``` composer require laravelcollective/html ``` <sub>not required if you don't need views</sub>
24+
``` composer require laravelcollective/html ```
25+
26+
<sub>(Note: This step is not required if you don't need views.)</sub>
2127

22-
3\. Publish config file and default-theme directory for views
28+
3\. Publish the configuration file and the default-theme directory for views:
2329

2430
``` php artisan vendor:publish --provider="Mrdebug\Crudgen\CrudgenServiceProvider" ```
2531

@@ -28,37 +34,37 @@ And since 1.9.2, a complete **REST API** !
2834

2935
### Create CRUD (or REST API)
3036

31-
Let's make a real life example : Build a blog
37+
Let's illustrate with a real life example : Building a blog
3238

3339
A `Post` has many (hasMany) `Comment` and belongs to many (belongsToMany) `Tag`
3440

3541
A `Post` can have a `title` and a `content` fields
3642

3743
Let's do this 🙂
3844

39-
<small>You need a REST API instead of a CRUD ? [Read this wiki](https://github.com/misterdebug/crud-generator-laravel/wiki/Make-a-complete-REST-API-instead-of-CRUD)</small>
45+
<sub>If you need a REST API instead of CRUD, [read this wiki](https://github.com/misterdebug/crud-generator-laravel/wiki/Make-a-complete-REST-API-instead-of-CRUD)</sub>
4046

4147
#### CRUD generator command :
4248

4349
``` php artisan make:crud nameOfYourCrud "column1:type, column2" ``` (theory)
4450

4551
``` php artisan make:crud post "title:string, content:text" ``` (for our example)
4652

47-
<small>[Available options](https://github.com/misterdebug/crud-generator-laravel/wiki/Available-options-when-you-use-make:crud-command)</small>
53+
<sub>[Available options](https://github.com/misterdebug/crud-generator-laravel/wiki/Available-options-when-you-use-make:crud-command)</sub>
4854

49-
When you call this command, controller, views and request are generated with your fields (here: title and content).
55+
When you call this command, the controller, views and request are generated with your fields (in this case, title and content).
5056
![image](https://user-images.githubusercontent.com/23297600/192172786-1703f7b8-f577-45c1-b0f9-296999827af2.png)
5157

5258
Now let's add our relationships (`Comment` and `Tag` models) :
5359

5460
![image](https://user-images.githubusercontent.com/23297600/192173041-6c71d727-1e29-4edc-9397-bdb07f44a378.png)
5561

56-
We add an `hasMany` relationship between our `Post` and `Comment`
62+
We add a `hasMany` relationship between our `Post` and `Comment`
5763
and a `belongsToMany` with `Tag`
5864

59-
If you look good, two migrations are created (`create_posts` AND `create_post_tag`).
65+
Two migrations are created (`create_posts` AND `create_post_tag`).
6066

61-
`create_posts` will be your table for your `Post` model
67+
`create_posts` is your table for your `Post` model
6268

6369
`create_post_tag` is a pivot table to handle the `belongsToMany` relationship
6470

@@ -80,7 +86,7 @@ A controller file is created in your **app/Http/Controllers** directory. All met
8086

8187
To create your routes for this new controller, you can do this :
8288

83-
``` Route::resource('posts', PostsController::class); ``` <small>(don't forget to import your `PostsController` in your `web.php` file)</small>
89+
``` Route::resource('posts', PostsController::class); ``` <sub><sup>(don't forget to import your `PostsController` in your `web.php` file)</sup></sub>
8490

8591
##### Screenshots
8692

@@ -91,7 +97,7 @@ To create your routes for this new controller, you can do this :
9197
`/posts` :
9298
![image](https://user-images.githubusercontent.com/23297600/192176845-b3722083-90a9-4257-90d1-8a2eb28baa01.png)
9399

94-
You can `edit` and `delete` too your new post. And a `show` page is created too 🙂
100+
You can `edit` and `delete` your new post. And a `show` page is created too 🙂
95101

96102
### Request
97103

@@ -100,7 +106,7 @@ A request file is created in your **app/Http/Requests** directory. By default, a
100106
### Views
101107

102108
A views directory is created in your **resources/views** directory.
103-
<sub>You want to customize generated views ? [https://github.com/misterdebug/crud-generator-laravel/wiki/Custom-your-views](https://github.com/misterdebug/crud-generator-laravel/wiki/Custom-your-views)</sub>
109+
<sub>If you want to customize generated views : [https://github.com/misterdebug/crud-generator-laravel/wiki/Custom-your-views](https://github.com/misterdebug/crud-generator-laravel/wiki/Custom-your-views)</sub>
104110

105111
You can create views independently of the CRUD generator with :
106112
``` php artisan make:views nameOfYourDirectoryViews "column1:type, column2" ```
@@ -122,13 +128,13 @@ Finished 🎉
122128

123129
## Remove a CRUD
124130

125-
You can delete all files (except migrations) created by the `make:crud` command at any time (you don't need to remove all files by hand)
131+
You can delete all files (except migrations) created by the `make:crud` command at any time. No need to remove files manually :
126132

127133
``` php artisan rm:crud nameOfYourCrud --force ```
128134

129135
``` php artisan rm:crud post --force ``` (in our example)
130136

131-
--force (optional) can delete all files without confirmation
137+
The `--force` flag (optional) deletes all files without confirmation
132138

133139
![image](https://user-images.githubusercontent.com/23297600/192183601-a4f8d206-3920-4f8a-8e0d-cf8442894e07.png)
134140

0 commit comments

Comments
 (0)