Skip to content

Commit

Permalink
docs: att README
Browse files Browse the repository at this point in the history
  • Loading branch information
otaaaviio committed Jun 21, 2024
1 parent 091f83e commit 99c9183
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ And I focus in the backend, so the frontend is simple and functional.
You can fork this project and make a pull request with your changes. I will be happy to review and accept your
contribution.
If you follow the current project pattern, everything will work fine. :D
A example to you follow:
<br>
A example to you follow, with this you can maintain the project clean and organized, with easy maintenance:

Resource:
Resource to lead with responses to client:

```php
class ModelResource extends JsonResource
Expand All @@ -164,7 +165,7 @@ class ModelResource extends JsonResource
}
```

Request:
Request to validate the request data:

```php
class ModelRequest extends FormRequest
Expand All @@ -178,7 +179,7 @@ class ModelRequest extends FormRequest
}
```

Exceptions:
Exceptions to lead with errors in a clean way and eay to understand:

```php
class ModelException extends Exception
Expand All @@ -205,7 +206,7 @@ class ModelException extends Exception
}
```

Controller:
Controller to receive request and return answer to client:

```php
public function store(ModelRequest $request)
Expand All @@ -224,7 +225,7 @@ public function store(ModelRequest $request)
}
```

Service:
Service to lead with business logic and return the resource to controller:

```php
public function create(array $data)
Expand Down Expand Up @@ -274,7 +275,7 @@ class SomeEvent implements ShouldBroadcast
}
}
```

With websockets you can add real-time features to your project, like chat, notifications and others.
For more infos, you can see the [Laravel Documentation](https://laravel.com/docs)

## Contact
Expand Down

0 comments on commit 99c9183

Please sign in to comment.