We don’t sell single courses, but you can purchase Monthly plan and cancel
after one month.
Also, check out avaiable discounts based on your country.
We don’t sell single courses, but you can purchase Monthly plan and cancel
after one month.
Also, check out avaiable discounts based on your country.
Structuring Laravel projects is one of the most typical questions I see in the community. The reason is that, for better or worse, Laravel has many options to do that!
In this course, I will provide an overview of the main options with real-life examples from open-source projects.
We will discuss:
As a practical example, we will try to shorten this Controller method:
public function store(Request $request)
{
$this->authorize('user_create');
$userData = $request->validate([
'name' => 'required',
'email' => 'required|unique:users',
'password' => 'required',
]);
$userData['start_at'] = Carbon::createFromFormat('m/d/Y', $request->start_at)->format('Y-m-d');
$userData['password'] = bcrypt($request->password);
$user = User::create($userData);
$user->roles()->sync($request->input('roles', []));
Project::create([
'user_id' => $user->id,
'name' => 'Demo project 1',
]);
Category::create([
'user_id' => $user->id,
'name' => 'Demo category 1',
]);
Category::create([
'user_id' => $user->id,
'name' => 'Demo category 2',
]);
MonthlyReport::where('month', now()->format('Y-m'))->increment('users_count');
$user->sendEmailVerificationNotification();
$admins = User::where('is_admin', 1)->get();
Notification::send($admins, new AdminNewUserNotification($user));
return response()->json([
'result' => 'success',
'data' => $user,
], 200);
}
For more complex topics, I intentionally used the word overview above. This course aims to show you the options, but each option is a "rabbit hole," often requiring an entirely separate course on that specific pattern.
So, at the end of the course, you will see a lesson with extra links to other resources from myself and the community if you choose to dive deeper into some structure topics.
A few testimonials from students:
Now, let's start our journey with the lesson Validation to Form Request.