[Laravel/Lumen] Novice and veteran engineers talk about "efficiency" [Beyond Study Group #30]

Hello!
This is Fukui from the Systems Development Department!

Suddenly, I think that for developers, writing programs that are "faster, less resource-intensive, and easier to read" is a mission and an important theme.
So, with the idea of ​​"let's learn all sorts of things to make development more efficient!", we focused on the "Laravel" and "Lumen" frameworks, which are frequently used in our PHP development, and co-hosted a study session with the cooperation of Extrance Co., Ltd.!

 

A talk about "efficiency" from novice and veteran engineers

This time, the main theme was "Efficiency as told by novice and veteran engineers," and we had three distinguished speakers speak about it!

1. "Let's streamline database access using Eloquent!" Masami Nishihara, Beyond Inc.
2. "Best practices learned from making full use of the collection function" Yoichi Bandai, Beyond Inc.
3. "A story about creating an internal application using Lumen" Yukichi Minami, Extrance Inc.

*Videos of each speaker's presentation can be viewed on YouTube via the title link

Session 1: "Let's use Eloquent to make DB access more efficient!"

The event began with a speech by Nishihara from our company Beyond

Like Nishihara, I've been an engineer for six months now, and the introductory statement, "It's not enough for it to just work...!!" really hit home for me!
After an overview of Laravel and MVC, focusing on load reduction and processing speed considerations, we moved on to a discussion about efficient model handling
. This time, we were given a clear demonstration of how to efficiently retrieve related records using the 'with function' in Eloquent.

After an explanation of the difference in the number of database accesses and the executed queries, a comparative test was conducted on the processing speed and memory usage compared to when the with function was not used, and the superiority of the with function was immediately apparent

I often use the with function in my work, and this has made me realize once again how convenient it is...!

In the second half, there was an attempt to use the chunk and cursor functions to find ways to reduce memory usage other than using the with function, which was very interesting!

Watch the presentation video here:
"Let's streamline database access using Eloquent!"

Session 2: "Best practices that can only be learned by making full use of the collection function"

The second session will be attended by Bandai from our company Beyond

The opening words "I've been using PHP for 15 years now" carry a lot of weight...!

This time, we learned about the overview, advantages and disadvantages, and usage of Collections.
I myself use Collections when manipulating arrays from time to time, but I still have much to learn, so there was a lot of useful information and points I would like to refer to.

In the first half of the lecture, the difference between Collection and foreach was explained using the example of performing multiple operations on an array, and the content was very easy to understand and satisfying

In addition, under the theme of "Collections can be used in tests," he introduced examples of using Collection methods in Unit tests, which I personally thought was something I should remember!

There were also many other questions, such as using Collection to find "unique combinations using three numbers between 1 and 10" and "a student's test score," so I hope you will take a look at the explanations in the video!

Watch the presentation video here:
"Best Practices Learned Through Thorough Use of the Collection Feature"

Session 3: "How we created an in-house application using Lumen"

For the final session, the third in the series, we had Mr. Minami from Extrance Co., Ltd. as our speaker!
He spoke on the topic of "Creating an internal application using Lumen," but first and foremost, we were captivated by Mr. Minami's "love for Gopher"...! (Please check out the presentation video for more details!)

Now, regarding the content of his presentation, Mr. Nankou first explained what motivated him to start using Lumen, gave an overview of Lumen, and then introduced us to the ``approval request email distribution app'' he actually created

In the first half of the talk, Mr. Nankou talked about himself before and after using Lumen, and what was impressive was how convenient the framework was!

After that, he will explain how to write Lumen's routing, controller (and model), and validation processes using code examples, and in the second half he will move on to the topic of "The differences between Lumen and Laravel."

He gave a more detailed explanation, including artisan commands that cannot be used in Lumen, loading Facade and Eloquent, and differences in how to write processes to obtain environment variables

At the end, he also summarises the advantages and disadvantages of Lumen, the framework's usability and features, and the differences with Laravel, so you can watch the presentation video for more specific details!

The video of the presentation is here:
"My experience building an internal company app using Lumen"

summary

How was it?
Throughout sessions 1 through 3, we received a broad and easy-to-understand explanation of efficient ways to use Laravel (Lumen), useful functions, and the differences between Laravel and Lumen. I believe the content will be very useful for everyone reading this article! (Personally, I found it to be a very valuable study session...!)

Beyond will continue to hold study sessions on infrastructure and development, so pleaseconnpass" or "Doorkeeperfeel free to join our next study session via

*If you register as a member of each community, you will be able to check immediately when study sessions are being held

・Beyond Study Group | connpass

・Beyond Study Group | Doorkeeper

lastly

I have launched "SEKARAKU Lab," a service site for the system development company I belong to.
Beyond offers a one-stop service for everything from server design and construction to operation, so please feel free to contact us if you have any problems with server-side development.
SEKARAKU Lab:[https://sekarakulab.beyondjapan.com/](https://sekarakulab.beyondjapan.com/)

Thank you for reading to the end!

If you found this article helpful,please give it a "Like"!
0
Loading...
0 votes, average: 0.00 / 10
1,911
X Facebook Hatena Bookmark pocket

The person who wrote this article

About the author

Hiroto Fukui

I joined Beyond in June 2020. I work in the Systems Development Department (Yokohama office).
My work mainly involves PHP, and I am in charge of developing game APIs, web systems, and Shopify private apps.
I like music in general, mainly Western music, and I play the guitar as a hobby. My favorite TV programs are "Detective! Night Scoop" and "Appearance! Admatic Heaven".