Skip to content

Commit 5387ee3

Browse files
Added option to not use Free Traits.
1 parent 69c1ff7 commit 5387ee3

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

docs/http.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,45 @@
33
HTTP Scaffolding in Larawiz are easy to do. Simply name a controller action, and add a series of steps to do inside the controller. Larawiz will automatically generate the code in your controller.
44

55
::: tip Controllers and Models
6-
Ensure your Models exists if you use them in any controller action. If not, you will get an error when trying to scaffolding.
6+
Ensure your Models exists if you use them in any controller action. If not, you will get an error when trying to scaffolding.
77
:::
88

99
## Creating a controller
1010

1111
Create an `http.yml` file, and populate the `controllers` key. You should get the gist of what's happening with just looking into the example.
1212

13-
1413
:::: tabs :options="{ useUrlFragment: false }"
1514
::: tab "YAML" id="controllers-example-tab-yaml"
1615
```yaml
1716
controllers:
1817

1918
PostController:
20-
index:
21-
get: /post
22-
actions:
23-
view:
24-
name: post.all
25-
with:
26-
posts: post.all
2719
show:
2820
route: get:/post/{post.slug}
2921
actions:
3022
view:
23+
receive:
3124
name: post.show
3225
with:
33-
posts: $post
34-
26+
post: $post
3527
create:
3628
route: get:/post/new
3729
actions:
3830

3931
```
4032
:::
4133
34+
::: tab "Routes" id="http-example-tab-routes"
35+
```php
36+
use Illuminate\Support\Facades\Route;
37+
use App\Http\Controllers\PostController;
38+
39+
Route::get('/post/{post.slug}', [PostController::class, 'show']);
40+
Route::post('/post', [PostController::class, 'create']);
41+
42+
```
43+
:::
44+
4245
::: tab "Controller" id="controllers-example-tab-controller"
4346
```php
4447
<?php

docs/model-columns/primary-key.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ When using [Quick Models](../model.md#quick-model), you can exchange the default
7474

7575
For both [Quick Models](../model.md#quick-model) and [Custom Models](../model.md#custom-model), Larawiz will automatically point and update the primary key inside the model, and include the `HasUuidPrimaryKey` trait for free alongside it, **right out of the box!**
7676

77+
::: tip Do not add free traits
78+
You can use the option `--no-free-traits` when calling Larawiz to not include the `HasUuidPrimaryKey` and other free traits.
79+
:::
80+
7781
:::: tabs :options="{ useUrlFragment: false }"
7882
::: tab "YAML" id="uuid-as-primary-key-yaml"
7983
```yaml{3}

0 commit comments

Comments
 (0)