Unable to use existing tables for laravel Eloquent
So I have been trying to follow some online links for understanding how eloquent can be used in defining relationships in table.What I would actually want to try is to use my existing tables for creating models and then define relationships using eloquent.
Now I am not using migrations, since I had already created my tables and have configured the connection and other settings(mysql) in the database.php as well as .env file.
Follwing is my Article modal:
<?php
namespace App;
use IlluminateDatabaseEloquentModel;
class Article extends Model
{
protected $table = 'articles';
}
Since I don't make use of any migrations, I have specified my table name(articles), where I have already inserted some data.
Now just to check whether the modal works properly, I tried giving a route in web.php as follows:
<?php
Route::get('/', function () {
echo Article::all();
});
But now when try running the same on the server, it gives me an error saying "Class Article not found".What seems to be the issue here?
Following is my .env file:
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:RVOuXWd9zPWrrdIEIHoezPBrfQqHPTihq4WUgXk3xjU=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=test
DB_USERNAME=root
DB_PASSWORD=shetty@123
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
Following is the database.php file:
<?php
return [
'default' => env('DB_CONNECTION', 'mysql'),
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
],
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'test'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'shetty@123'),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
],
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
],
],
'migrations' => 'migrations',
'redis' => [
'client' => 'predis',
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],
];
php mysql laravel eloquent
add a comment |
So I have been trying to follow some online links for understanding how eloquent can be used in defining relationships in table.What I would actually want to try is to use my existing tables for creating models and then define relationships using eloquent.
Now I am not using migrations, since I had already created my tables and have configured the connection and other settings(mysql) in the database.php as well as .env file.
Follwing is my Article modal:
<?php
namespace App;
use IlluminateDatabaseEloquentModel;
class Article extends Model
{
protected $table = 'articles';
}
Since I don't make use of any migrations, I have specified my table name(articles), where I have already inserted some data.
Now just to check whether the modal works properly, I tried giving a route in web.php as follows:
<?php
Route::get('/', function () {
echo Article::all();
});
But now when try running the same on the server, it gives me an error saying "Class Article not found".What seems to be the issue here?
Following is my .env file:
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:RVOuXWd9zPWrrdIEIHoezPBrfQqHPTihq4WUgXk3xjU=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=test
DB_USERNAME=root
DB_PASSWORD=shetty@123
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
Following is the database.php file:
<?php
return [
'default' => env('DB_CONNECTION', 'mysql'),
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
],
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'test'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'shetty@123'),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
],
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
],
],
'migrations' => 'migrations',
'redis' => [
'client' => 'predis',
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],
];
php mysql laravel eloquent
You need to specify full path of your model which is usually inside App Directory.
– InvincibleElf
Nov 19 '18 at 3:30
As in inside the route??
– MVS
Nov 19 '18 at 3:41
add a comment |
So I have been trying to follow some online links for understanding how eloquent can be used in defining relationships in table.What I would actually want to try is to use my existing tables for creating models and then define relationships using eloquent.
Now I am not using migrations, since I had already created my tables and have configured the connection and other settings(mysql) in the database.php as well as .env file.
Follwing is my Article modal:
<?php
namespace App;
use IlluminateDatabaseEloquentModel;
class Article extends Model
{
protected $table = 'articles';
}
Since I don't make use of any migrations, I have specified my table name(articles), where I have already inserted some data.
Now just to check whether the modal works properly, I tried giving a route in web.php as follows:
<?php
Route::get('/', function () {
echo Article::all();
});
But now when try running the same on the server, it gives me an error saying "Class Article not found".What seems to be the issue here?
Following is my .env file:
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:RVOuXWd9zPWrrdIEIHoezPBrfQqHPTihq4WUgXk3xjU=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=test
DB_USERNAME=root
DB_PASSWORD=shetty@123
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
Following is the database.php file:
<?php
return [
'default' => env('DB_CONNECTION', 'mysql'),
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
],
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'test'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'shetty@123'),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
],
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
],
],
'migrations' => 'migrations',
'redis' => [
'client' => 'predis',
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],
];
php mysql laravel eloquent
So I have been trying to follow some online links for understanding how eloquent can be used in defining relationships in table.What I would actually want to try is to use my existing tables for creating models and then define relationships using eloquent.
Now I am not using migrations, since I had already created my tables and have configured the connection and other settings(mysql) in the database.php as well as .env file.
Follwing is my Article modal:
<?php
namespace App;
use IlluminateDatabaseEloquentModel;
class Article extends Model
{
protected $table = 'articles';
}
Since I don't make use of any migrations, I have specified my table name(articles), where I have already inserted some data.
Now just to check whether the modal works properly, I tried giving a route in web.php as follows:
<?php
Route::get('/', function () {
echo Article::all();
});
But now when try running the same on the server, it gives me an error saying "Class Article not found".What seems to be the issue here?
Following is my .env file:
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:RVOuXWd9zPWrrdIEIHoezPBrfQqHPTihq4WUgXk3xjU=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=test
DB_USERNAME=root
DB_PASSWORD=shetty@123
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
Following is the database.php file:
<?php
return [
'default' => env('DB_CONNECTION', 'mysql'),
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
],
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'test'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'shetty@123'),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
],
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
],
],
'migrations' => 'migrations',
'redis' => [
'client' => 'predis',
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],
];
php mysql laravel eloquent
php mysql laravel eloquent
edited Nov 19 '18 at 3:57
MVS
asked Nov 19 '18 at 3:24
MVSMVS
6528
6528
You need to specify full path of your model which is usually inside App Directory.
– InvincibleElf
Nov 19 '18 at 3:30
As in inside the route??
– MVS
Nov 19 '18 at 3:41
add a comment |
You need to specify full path of your model which is usually inside App Directory.
– InvincibleElf
Nov 19 '18 at 3:30
As in inside the route??
– MVS
Nov 19 '18 at 3:41
You need to specify full path of your model which is usually inside App Directory.
– InvincibleElf
Nov 19 '18 at 3:30
You need to specify full path of your model which is usually inside App Directory.
– InvincibleElf
Nov 19 '18 at 3:30
As in inside the route??
– MVS
Nov 19 '18 at 3:41
As in inside the route??
– MVS
Nov 19 '18 at 3:41
add a comment |
1 Answer
1
active
oldest
votes
The issue is that your Article class is in a different namespace than your routes file.
At the top of your routes file include this statement:
use AppArticle;
You can now reference the Article class in your route closure as Article::method();
Or alternatively, precede the call to all() as so:
AppArticle:all();
But make sure you do one or the other, not both as it is unnecessary.
Hey thanks for the help, I added the statement, and it now shows me the following error:could not find driver (SQL: select * fromarticles)
– MVS
Nov 19 '18 at 3:47
What's your config/database.php and .env file look like?
– Polaris
Nov 19 '18 at 3:50
ok wait, I am updating my post and will paste the code there
– MVS
Nov 19 '18 at 3:52
Please check it now.
– MVS
Nov 19 '18 at 3:57
Looks to me like the mysql php extension is not enabled. What's your dev environment? Are you using laravel valet or something like XAMPP perhaps? Running "php -m" in your console/terminal should tell you if mysql module is installed.
– Polaris
Nov 19 '18 at 4:07
|
show 10 more comments
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53367901%2funable-to-use-existing-tables-for-laravel-eloquent%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The issue is that your Article class is in a different namespace than your routes file.
At the top of your routes file include this statement:
use AppArticle;
You can now reference the Article class in your route closure as Article::method();
Or alternatively, precede the call to all() as so:
AppArticle:all();
But make sure you do one or the other, not both as it is unnecessary.
Hey thanks for the help, I added the statement, and it now shows me the following error:could not find driver (SQL: select * fromarticles)
– MVS
Nov 19 '18 at 3:47
What's your config/database.php and .env file look like?
– Polaris
Nov 19 '18 at 3:50
ok wait, I am updating my post and will paste the code there
– MVS
Nov 19 '18 at 3:52
Please check it now.
– MVS
Nov 19 '18 at 3:57
Looks to me like the mysql php extension is not enabled. What's your dev environment? Are you using laravel valet or something like XAMPP perhaps? Running "php -m" in your console/terminal should tell you if mysql module is installed.
– Polaris
Nov 19 '18 at 4:07
|
show 10 more comments
The issue is that your Article class is in a different namespace than your routes file.
At the top of your routes file include this statement:
use AppArticle;
You can now reference the Article class in your route closure as Article::method();
Or alternatively, precede the call to all() as so:
AppArticle:all();
But make sure you do one or the other, not both as it is unnecessary.
Hey thanks for the help, I added the statement, and it now shows me the following error:could not find driver (SQL: select * fromarticles)
– MVS
Nov 19 '18 at 3:47
What's your config/database.php and .env file look like?
– Polaris
Nov 19 '18 at 3:50
ok wait, I am updating my post and will paste the code there
– MVS
Nov 19 '18 at 3:52
Please check it now.
– MVS
Nov 19 '18 at 3:57
Looks to me like the mysql php extension is not enabled. What's your dev environment? Are you using laravel valet or something like XAMPP perhaps? Running "php -m" in your console/terminal should tell you if mysql module is installed.
– Polaris
Nov 19 '18 at 4:07
|
show 10 more comments
The issue is that your Article class is in a different namespace than your routes file.
At the top of your routes file include this statement:
use AppArticle;
You can now reference the Article class in your route closure as Article::method();
Or alternatively, precede the call to all() as so:
AppArticle:all();
But make sure you do one or the other, not both as it is unnecessary.
The issue is that your Article class is in a different namespace than your routes file.
At the top of your routes file include this statement:
use AppArticle;
You can now reference the Article class in your route closure as Article::method();
Or alternatively, precede the call to all() as so:
AppArticle:all();
But make sure you do one or the other, not both as it is unnecessary.
answered Nov 19 '18 at 3:27
PolarisPolaris
776113
776113
Hey thanks for the help, I added the statement, and it now shows me the following error:could not find driver (SQL: select * fromarticles)
– MVS
Nov 19 '18 at 3:47
What's your config/database.php and .env file look like?
– Polaris
Nov 19 '18 at 3:50
ok wait, I am updating my post and will paste the code there
– MVS
Nov 19 '18 at 3:52
Please check it now.
– MVS
Nov 19 '18 at 3:57
Looks to me like the mysql php extension is not enabled. What's your dev environment? Are you using laravel valet or something like XAMPP perhaps? Running "php -m" in your console/terminal should tell you if mysql module is installed.
– Polaris
Nov 19 '18 at 4:07
|
show 10 more comments
Hey thanks for the help, I added the statement, and it now shows me the following error:could not find driver (SQL: select * fromarticles)
– MVS
Nov 19 '18 at 3:47
What's your config/database.php and .env file look like?
– Polaris
Nov 19 '18 at 3:50
ok wait, I am updating my post and will paste the code there
– MVS
Nov 19 '18 at 3:52
Please check it now.
– MVS
Nov 19 '18 at 3:57
Looks to me like the mysql php extension is not enabled. What's your dev environment? Are you using laravel valet or something like XAMPP perhaps? Running "php -m" in your console/terminal should tell you if mysql module is installed.
– Polaris
Nov 19 '18 at 4:07
Hey thanks for the help, I added the statement, and it now shows me the following error:could not find driver (SQL: select * from
articles)– MVS
Nov 19 '18 at 3:47
Hey thanks for the help, I added the statement, and it now shows me the following error:could not find driver (SQL: select * from
articles)– MVS
Nov 19 '18 at 3:47
What's your config/database.php and .env file look like?
– Polaris
Nov 19 '18 at 3:50
What's your config/database.php and .env file look like?
– Polaris
Nov 19 '18 at 3:50
ok wait, I am updating my post and will paste the code there
– MVS
Nov 19 '18 at 3:52
ok wait, I am updating my post and will paste the code there
– MVS
Nov 19 '18 at 3:52
Please check it now.
– MVS
Nov 19 '18 at 3:57
Please check it now.
– MVS
Nov 19 '18 at 3:57
Looks to me like the mysql php extension is not enabled. What's your dev environment? Are you using laravel valet or something like XAMPP perhaps? Running "php -m" in your console/terminal should tell you if mysql module is installed.
– Polaris
Nov 19 '18 at 4:07
Looks to me like the mysql php extension is not enabled. What's your dev environment? Are you using laravel valet or something like XAMPP perhaps? Running "php -m" in your console/terminal should tell you if mysql module is installed.
– Polaris
Nov 19 '18 at 4:07
|
show 10 more comments
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53367901%2funable-to-use-existing-tables-for-laravel-eloquent%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You need to specify full path of your model which is usually inside App Directory.
– InvincibleElf
Nov 19 '18 at 3:30
As in inside the route??
– MVS
Nov 19 '18 at 3:41