Episode - https://laracasts.com/series/real-time-games-with-laravel/episodes/1
This will be tic-tac-toe with Laravel, Inertia.js and Vue.js. It’s been a few months since I touched brutalbudget.com code (my Vue.js project) so this will be a nice refresher.
This first episode is about creating the Game model which will allow matching up two players. It feels like a kata to scaffold all is needed around the model. Even if this is something a Laravel dev does pretty often is impossible to get to the end without even a tiny mistake.
use artisan to create model, factory, migration, policy and resource
define the migration to connect foreign ids for player one and player two
add relationship to the game model to connect it to users
run the seeded to get the test user ready in Laravel Breeze
create a first Inertia Link in the UI to allow the creation of a game through POST request
implement store and show method in the Game controller
add routes in web.php through
Route::resource()->only(['store', 'show'])
go back to the Game model to add the
$fillable
property as the app throws an error as soon as we try to save a Game 😅