How can we use the custom table in Laravel?

0 votes
What is the use of custom table and how can we define that in Laravel?
Mar 20 in Laravel by kartik
• 4,560 points
23 views

1 answer to this question.

0 votes

Hey,

We can easily use custom table in Laravel by overriding protected $table property of Eloquent. Here, is the sample:

 class User extends Eloquent{  

        protected $table="my_user_table";  

  }

Thank you!

answered Mar 20 by Niroj
• 8,620 points

Related Questions In Laravel

0 votes
1 answer

How can we generate migration in Laravel?

Hello, Migrations are like version control for your database, ...READ MORE

answered Mar 19 in Laravel by Niroj
• 8,620 points
22 views
0 votes
1 answer

How can someone change the default database type in Laravel?

Laravel is configured to use MySQL by ...READ MORE

answered Mar 20 in Laravel by Niroj
• 8,620 points
27 views
0 votes
1 answer

How can we create a record in Laravel using eloquent?

We need to create a new model ...READ MORE

answered Mar 20 in Laravel by Niroj
• 8,620 points
29 views
0 votes
1 answer

How can we use controller once it was created successfully?

Hey kartik You can  first refer how to  ...READ MORE

answered Mar 18 in Laravel by Niroj
• 8,620 points
19 views
0 votes
1 answer

What is Laravel framework? Why one should use Laravel?

Laravel is a PHP web-framework; it utilized ...READ MORE

answered Mar 17 in Laravel by Niroj
• 8,620 points
32 views
0 votes
1 answer

How to download and install Lavavel framework?

Hey @kartik, First you must have xampp install ...READ MORE

answered Mar 17 in Laravel by Niroj
• 8,620 points
30 views
0 votes
1 answer

Display Laravel in browser by using cmd promt?

Hello, First you need to have laravel install ...READ MORE

answered Mar 17 in Laravel by Niroj
• 8,620 points
19 views
0 votes
1 answer

How can we get started with Laravel through Xampp?

Hii, First you need to start Apache and ...READ MORE

answered Mar 17 in Laravel by Niroj
• 8,620 points
21 views
0 votes
1 answer

How can we check the logged-in user info in Laravel?

Hey @kartik, yes we can keep track of ...READ MORE

answered Mar 20 in Laravel by Niroj
• 8,620 points
23 views
0 votes
1 answer

What is middleware? How can we register middeleware in Laravel?

Middleware acts as a bridge between a ...READ MORE

answered Mar 18 in Laravel by Niroj
• 8,620 points
59 views