I check some discussions but i did not find any example...
I'm new to Laravel and i want integrate Laravel to my existing web site. My website have over 100 tables with a lot of rows....
Let's take a look at my existing table profiles, how do I create a model to query/update/insert/delete rows in my existing table profiles. My table has more than 50 fields ....
I know how to create a new model for a new table : php artisan make:model NewTable...
But for my existing table profiles... should i do php artisan make:model Profiles
Yes, you can create a create a model php artisan make:model Profile and then create its controller to handle CRUD operations. (Rememer the name of the model should be singular, not plural so that automatically the name of the table becomes the pluraliza name.) That is,
Model: User, Table: users
Model: Order, Table: orders
etc
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Profile extends Model
{
protected $guarded = [];
}
Depends on what you want to do with the data. You may want to custom setters and getters, add relationships, etc. It all depends on your workflow mate....