Laravel Examples

News

June 28th, 2021

laravelexamples.jpg

Povilas Korop, the creator of Laravel Daily, started a brand new project called Laravel Examples that is a catalog of code examples, structured by topic and by the projects.

I like the idea behind this project, and I think it could be a great way of learning about new concepts from existing code or even finding how others are implementing different patterns.

For example, let's say you need to create your own helpers for a project and would like to see how others are doing it. In the example from Akaunting you can see how they load their custom files through Composer:

1// We autoload that helper file in our composer.json
2 
3{
4 "name": "akaunting/akaunting",
5 "description": "Free accounting software, based on Laravel framework.",
6 // ... other values
7 
8 "autoload": {
9 "files": [
10 "app/Utilities/helpers.php"
11 ]
12 },
13 
14 // ... other values
15}

Then see precisely where the helpers are called and how they structured their code. I'm sure as Povilas adds more and more examples to the site, it will be an even better learning resource. Check out Laravel Examples and send him any feedback.

Filed in:

Eric L. Barnes

Eric is the creator of Laravel News and has been covering Laravel since 2012.