High Performance with Laravel Octane by Roberto Butti
Author:Roberto Butti
Language: eng
Format: epub
Publisher: Packt
Published: 2023-12-15T00:00:00+00:00
Creating an events table
When you are creating a table in Laravel, you have to use a migration file. A migration file contains the logic to create the table and all fields. It contains all the instructions to define the structure of your table. To manage the logic for using the data stored in the table, you might need other things such as the model and seeder classes.
The model class allows the developer to access the data and provides some methods for saving, deleting, loading, and querying data.
The seeder class is used to fill the table with initial values or sample values.
To create the model class, the seeder class, and the migration file, you can use the make:model command with the m (create a migration file) and s (create a seeder class) parameters:
php artisan make:model Event -ms
With the make:model command and the m and s parameters, three files are created:
The migration file is created in database/migration/, with the name consisting of the timestamp as the prefix and create_events_table as the suffix, for example, 2022_08_22_210043_create_events_table.php
The model class in app/Models/Event.php
The seeder class file in app/database/seeders/EventSeeder.php
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Web Development with Julia and Genie by Ivo Balbaert & Adrian Salceanu(6056)
State Management with React Query by Daniel Afonso(3389)
Eleventy by Example by Robinson Bryan;(3311)
Architecting Vue.js 3 Enterprise-Ready Web Applications by Solomon Eseme(3019)
Building Python Web APIs with FastAPI by Abdulazeez Abdulazeez Adeshina(2917)
Digital Marketing with Drupal by José Fernandes(2821)
Becoming an Enterprise Django Developer by Michael Dinder(1238)
Building Python Web APIs with FastAPI: A fast-paced guide to building high-performance, robust web APIs with very little boilerplate code by Abdulazeez Abdulazeez Adeshina(1173)
Operator Training Simulator Handbook by Joseph Philip(1142)
Practical WebAssembly: Explore the fundamentals of WebAssembly programming using Rust by Sendil Kumar Nellaiyapen(1069)
Google Workspace User Guide: A Practical Guide to Using Google Workspace Apps Efficiently While Integrating Them With Your Data by Balaji Iyer(1057)
Hands-on Cloud Analytics with Microsoft Azure Stack: Transform Your Data to Derive Powerful Insights Using Microsoft Azure by Prashila Naik(1037)
State Management with React Query by Afonso Daniel;(1030)
Building SPAs with Django and HTML Over the Wire: Learn to build real-time single page applications with Python by Andros Fenollosa(991)
Modern Frontend Development with Node.js by Florian Rappl(921)
High Performance with Laravel Octane by R. Butti(910)
Building Data Science Applications with FastAPI by François Voron(906)
Kubernetes Design Patterns and Extensions by Onur Yilmaz(899)
JavaScript from Frontend to Backend by Unknown(811)
