I am getting error after composer update
QueryException in Connection.php line 636:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'war_id' in 'where clause'
I have 3 tables in many to many relationship
wars table
id - int pk
locations table
id - int pk
war_locations table
id - int pk
war_id int
location_id int
war_locations table is pivot table.
I have declared relation ship in model
War.php
public function locations()
{
return $this->belongsToMany('App\Models\Location', 'war_locations', 'war_id', 'location_id');
}
But when i try to get location of a war then it fails.
$wars = War::with('locations')->where('status',1)->get();
It was working before composer update
I dont know why it is trying to find war_id in pivot table.
Complete exception:
`PDOException in Connection.php line 310:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'war_id' in 'where clause'
in Connection.php line 310
at PDO->prepare('select * from `wc_locations` where `war_id` = ?') in Connection.php line 310
at Connection->Illuminate\Database\{closure}(object(MySqlConnection), 'select * from `wc_locations` where `war_id` = ?', array('2')) in Connection.php line 629
at Connection->runQueryCallback('select * from `wc_locations` where `war_id` = ?', array('2'), object(Closure)) in Connection.php line 596
at Connection->run('select * from `wc_locations` where `war_id` = ?', array('2'), object(Closure)) in Connection.php line 315
at Connection->select('select * from `wc_locations` where `war_id` = ?', array('2'), true) in Builder.php line 1389
at Builder->runSelect() in Builder.php line 1379
at Builder->getFresh(array('*')) in Builder.php line 1364
at Builder->get(array('*')) in Builder.php line 409
at Builder->getModels() in BelongsToMany.php line 176
at BelongsToMany->get() in BelongsToMany.php line 99
at BelongsToMany->getResults() in Model.php line 2699
at Model->getRelationshipFromMethod('locations') in Model.php line 2665
at Model->getRelationValue('locations') in Model.php line 2607
at Model->getAttribute('locations') in Model.php line 3325
at Model->__get('locations') in War.php line 102
at War->getLocationListAttribute(null) in Model.php line 2722
at Model->mutateAttribute('location_list', null) in Model.php line 2734
at Model->mutateAttributeForArray('location_list', null) in Model.php line 2494
at Model->attributesToArray() in Model.php line 2434
at Model->toArray() in Collection.php line 902
at Collection->Illuminate\Support\{closure}(object(War))
at array_map(object(Closure), array(object(War), object(War), object(War), object(War), object(War), object(War))) in Collection.php line 904
at Collection->toArray() in Collection.php line 914
at Collection->jsonSerialize()
at json_encode(object(Collection)) in 6823600b52dddc7dc45dcf9b454ab6d0 line 559
at include('/home/aditya/public_html/warcircle/storage/framework/views/6823600b52dddc7dc45dcf9b454ab6d0') in PhpEngine.php line 42
at PhpEngine->evaluatePath('/home/aditya/public_html/warcircle/storage/framework/views/6823600b52dddc7dc45dcf9b454ab6d0', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'wars' => object(Collection), 'user' => null, 'trendingWars' => array(object(War), object(War)), 'topWars' => object(Collection))) in CompilerEngine.php line 58
at CompilerEngine->get('/home/aditya/public_html/warcircle/resources/views/site/home/index.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'wars' => object(Collection), 'user' => null, 'trendingWars' => array(object(War), object(War)), 'topWars' => object(Collection))) in View.php line 138
at View->getContents() in View.php line 107
at View->renderContents() in View.php line 81
at View->render() in Response.php line 51
at Response->setContent(object(View)) in Response.php line 202
at Response->__construct(object(View)) in Router.php line 1225
at Router->prepareResponse(object(Request), object(View)) in ControllerDispatcher.php line 113
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 114
at ControllerDispatcher->callWithinStack(object(HomeController), object(Route), object(Request), 'index') in ControllerDispatcher.php line 69
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\Site\HomeController', 'index') in Route.php line 201
at Route->runWithCustomDispatcher(object(Request)) in Route.php line 134
at Route->run(object(Request)) in Router.php line 704
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Router.php line 706
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 671
at Router->dispatchToRoute(object(Request)) in Router.php line 631
at Router->dispatch(object(Request)) in Kernel.php line 236
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 50
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 62
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 122
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87
at Kernel->handle(object(Request)) in index.php line 54`
It looks like the keys in your relationship are in the wrong order. Try swapping war_id and location_id like so:
public function locations()
{
return $this->belongsToMany('App\Models\Location', 'war_locations', 'location_id', 'war_id');
}
Related
I tried to deploy my first Laravel project on Heroku. It's a small project, so I'm using SQLite as my database. After deploying the project using git push heroku master, and clicking on one of the links that retrieves data from the database to display an index, I am getting the following error:
PDOException in Connector.php line 55: could not find driver
in Connector.php line 55
at PDO->__construct('sqlite:/app/database/database.sqlite', null, null, array('0', '2', '0', false, false)) in Connector.php line 55
at Connector->createConnection('sqlite:/app/database/database.sqlite', array('driver' => 'sqlite', 'database' => '/app/database/database.sqlite', 'prefix' => '', 'name' => 'sqlite'), array('0', '2', '0', false, false)) in SQLiteConnector.php line 37
at SQLiteConnector->connect(array('driver' => 'sqlite', 'database' => '/app/database/database.sqlite', 'prefix' => '', 'name' => 'sqlite')) in ConnectionFactory.php line 61
at ConnectionFactory->Illuminate\Database\Connectors\{closure}()
at call_user_func(object(Closure)) in Connection.php line 875
at Connection->getPdo() in Connection.php line 743
at Connection->reconnectIfMissingConnection() in Connection.php line 628
at Connection->run('select * from "certificates" order by "updated_at" desc', array(), object(Closure)) in Connection.php line 342
at Connection->select('select * from "certificates" order by "updated_at" desc', array(), true) in Builder.php line 1562
at Builder->runSelect() in Builder.php line 1548
at Builder->get(array('*')) in Builder.php line 610
at Builder->getModels(array('*')) in Builder.php line 316
at Builder->get() in CertificatesController.php line 25
at CertificatesController->index()
at call_user_func_array(array(object(CertificatesController), 'index'), array()) in Controller.php line 80
at Controller->callAction('index', array()) in ControllerDispatcher.php line 146
at ControllerDispatcher->call(object(CertificatesController), object(Route), 'index') in ControllerDispatcher.php line 94
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 96
at ControllerDispatcher->callWithinStack(object(CertificatesController), object(Route), object(Request), 'index') in ControllerDispatcher.php line 54
at ControllerDispatcher->dispatch(object(Route), object(Request), 'app\Http\Controllers\CertificatesController', 'index') in Route.php line 174
at Route->runController(object(Request)) in Route.php line 140
at Route->run(object(Request)) in Router.php line 724
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 64
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 62
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in Router.php line 726
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 699
at Router->dispatchToRoute(object(Request)) in Router.php line 675
at Router->dispatch(object(Request)) in Kernel.php line 246
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 44
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in Kernel.php line 132
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 99
at Kernel->handle(object(Request)) in index.php line 53
Anyone knows how I may be able to resolve this problem? Many thanks in advance! :)
I've also encountered this on Heroku.
I added:
{
"require": {
"ext-pdo_sqlite": "*"
}
}
Sqlite is setup as a shared extension on Heroku, but has to be enabled through composer.json i believe.
Try adding:
{
"require": {
"sqlite3": "*"
}
}
To your composer.json file.
i just did a migration in Laravel. I noticed that in the users table there are several columns: id, name, email and so on. I changed the the column named "name" to "username" and i put it as a unique column. Now when I start my app and try to register i get 2 exeptions: QueryExpetion and PDOExeption. I thought that I should change something in the Builder.php bou there is no such thing in there. These are the error I got. What do I need to change?!
QueryException in Connection.php line 651: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'name' in 'where clause' (SQL: select count(*) as aggregate from `users` where `name` = kosach)
in Connection.php line 651
at Connection->runQueryCallback('select count(*) as aggregate from `users` where `name` = ?', array('kosach'), object(Closure)) in Connection.php line 611
at Connection->run('select count(*) as aggregate from `users` where `name` = ?', array('kosach'), object(Closure)) in Connection.php line 324
at Connection->select('select count(*) as aggregate from `users` where `name` = ?', array('kosach'), true) in Builder.php line 1406
at Builder->runSelect() in Builder.php line 1383
at Builder->get(array('*')) in Builder.php line 1718
at Builder->aggregate('count', array('*')) in Builder.php line 1638
at Builder->count() in DatabasePresenceVerifier.php line 57
at DatabasePresenceVerifier->getCount('users', 'name', 'kosach', null, null, array()) in Validator.php line 1070
at Validator->validateUnique('name', 'kosach', array('users'), object(Validator)) in Validator.php line 362
at Validator->validate('name', 'unique:users') in Validator.php line 314
at Validator->passes() in Validator.php line 335
at Validator->fails() in RegistersUsers.php line 32
at AuthController->postRegister(object(Request))
at call_user_func_array(array(object(AuthController), 'postRegister'), array(object(Request))) in Controller.php line 256
at Controller->callAction('postRegister', array(object(Request))) in ControllerDispatcher.php line 164
at ControllerDispatcher->call(object(AuthController), object(Route), 'postRegister') in ControllerDispatcher.php line 112
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in RedirectIfAuthenticated.php line 45
at RedirectIfAuthenticated->handle(object(Request), object(Closure))
at call_user_func_array(array(object(RedirectIfAuthenticated), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 114
at ControllerDispatcher->callWithinStack(object(AuthController), object(Route), object(Request), 'postRegister') in ControllerDispatcher.php line 69
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\Auth\AuthController', 'postRegister') in Route.php line 203
at Route->runWithCustomDispatcher(object(Request)) in Route.php line 134
at Route->run(object(Request)) in Router.php line 704
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Router.php line 706
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 671
at Router->dispatchToRoute(object(Request)) in Router.php line 631
at Router->dispatch(object(Request)) in Kernel.php line 236
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 50
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 62
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 122
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87
at Kernel->handle(object(Request)) in index.php line 54
1/2 PDOException in Connection.php line 319: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'name' in 'where clause'
in Connection.php line 319
at PDO->prepare('select count(*) as aggregate from `users` where `name` = ?') in Connection.php line 319
at Connection->Illuminate\Database\{closure}(object(MySqlConnection), 'select count(*) as aggregate from `users` where `name` = ?', array('kosach')) in Connection.php line 644
at Connection->runQueryCallback('select count(*) as aggregate from `users` where `name` = ?', array('kosach'), object(Closure)) in Connection.php line 611
at Connection->run('select count(*) as aggregate from `users` where `name` = ?', array('kosach'), object(Closure)) in Connection.php line 324
at Connection->select('select count(*) as aggregate from `users` where `name` = ?', array('kosach'), true) in Builder.php line 1406
at Builder->runSelect() in Builder.php line 1383
at Builder->get(array('*')) in Builder.php line 1718
at Builder->aggregate('count', array('*')) in Builder.php line 1638
at Builder->count() in DatabasePresenceVerifier.php line 57
at DatabasePresenceVerifier->getCount('users', 'name', 'kosach', null, null, array()) in Validator.php line 1070
at Validator->validateUnique('name', 'kosach', array('users'), object(Validator)) in Validator.php line 362
at Validator->validate('name', 'unique:users') in Validator.php line 314
at Validator->passes() in Validator.php line 335
at Validator->fails() in RegistersUsers.php line 32
at AuthController->postRegister(object(Request))
at call_user_func_array(array(object(AuthController), 'postRegister'), array(object(Request))) in Controller.php line 256
at Controller->callAction('postRegister', array(object(Request))) in ControllerDispatcher.php line 164
at ControllerDispatcher->call(object(AuthController), object(Route), 'postRegister') in ControllerDispatcher.php line 112
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in RedirectIfAuthenticated.php line 45
at RedirectIfAuthenticated->handle(object(Request), object(Closure))
at call_user_func_array(array(object(RedirectIfAuthenticated), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 114
at ControllerDispatcher->callWithinStack(object(AuthController), object(Route), object(Request), 'postRegister') in ControllerDispatcher.php line 69
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\Auth\AuthController', 'postRegister') in Route.php line 203
at Route->runWithCustomDispatcher(object(Request)) in Route.php line 134
at Route->run(object(Request)) in Router.php line 704
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Router.php line 706
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 671
at Router->dispatchToRoute(object(Request)) in Router.php line 631
at Router->dispatch(object(Request)) in Kernel.php line 236
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 50
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 62
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 122
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87
at Kernel->handle(object(Request)) in index.php line 54
The default AuthController uses name for creating the user in the create method.
Change this line's key to username.
Well even though you’ve changed the name of the column in your database, it looks like somewhere in your code you’re still referencing name.
I'm just beginning laravel and when i try to return articles JSON from sqlite, i get this driver error.
public function index(){
$articles = \App\Article::all();
return $articles;
}
Whoops, looks like something went wrong.
1/1 PDOException in Connector.php line 55: could not find driver
in Connector.php line 55
at PDO->__construct('sqlite:/srv/http/laravel/storage/database.sqlite', null, null, array('0', '2', '0', false, false)) in Connector.php line 55
at Connector->createConnection('sqlite:/srv/http/laravel/storage/database.sqlite', array('driver' => 'sqlite', 'database' => '/srv/http/laravel/storage/database.sqlite', 'prefix' => '', 'name' => 'sqlite'), array('0', '2', '0', false, false)) in SQLiteConnector.php line 37
at SQLiteConnector->connect(array('driver' => 'sqlite', 'database' => '/srv/http/laravel/storage/database.sqlite', 'prefix' => '', 'name' => 'sqlite')) in ConnectionFactory.php line 60
at ConnectionFactory->createSingleConnection(array('driver' => 'sqlite', 'database' => '/srv/http/laravel/storage/database.sqlite', 'prefix' => '', 'name' => 'sqlite')) in ConnectionFactory.php line 49
at ConnectionFactory->make(array('driver' => 'sqlite', 'database' => '/srv/http/laravel/storage/database.sqlite', 'prefix' => ''), 'sqlite') in DatabaseManager.php line 175
at DatabaseManager->makeConnection('sqlite') in DatabaseManager.php line 67
at DatabaseManager->connection(null) in Model.php line 3245
at Model::resolveConnection(null) in Model.php line 3211
at Model->getConnection() in Model.php line 1914
at Model->newBaseQueryBuilder() in Model.php line 1857
at Model->newQueryWithoutScopes() in Model.php line 1831
at Model->newQuery() in Model.php line 667
at Model::all() in ArticlesController.php line 14
at ArticlesController->index()
at call_user_func_array(array(object(ArticlesController), 'index'), array()) in Controller.php line 256
at Controller->callAction('index', array()) in ControllerDispatcher.php line 164
at ControllerDispatcher->call(object(ArticlesController), object(Route), 'index') in ControllerDispatcher.php line 112
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 114
at ControllerDispatcher->callWithinStack(object(ArticlesController), object(Route), object(Request), 'index') in ControllerDispatcher.php line 69
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\ArticlesController', 'index') in Route.php line 201
at Route->runWithCustomDispatcher(object(Request)) in Route.php line 134
at Route->run(object(Request)) in Router.php line 704
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Router.php line 706
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 671
at Router->dispatchToRoute(object(Request)) in Router.php line 631
at Router->dispatch(object(Request)) in Kernel.php line 236
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 50
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 62
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42`enter code here`
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 122
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87
at Kernel->handle(object(Request)) in index.php line 54
at require_once('/srv/http/laravel/public/index.php') in server.php line 21
Please be sure you've installedpdo and pdo_sqlite extensions properly.
php -v will output if are there any missing extension files.
You should have these packages sqlite, php5-sqlite . And built with pecl. pecl install pdo && pecl install pdo_sqlite . Lastly you should enable pdo, pdo_sqlite extensions in your php.ini. According to your phpinfo() output, your php.ini file is /etc/php/php.ini
And again according to your phpinfo() output, your extension folder is /usr/lib/php/modules/ . There should be pdo_sqlite.so file in this directory.
I found out that if we can write to the database, then the connection is working fine. We all faced the issue when trying to retrieve from database. I resolved this issue by restarting the server. That worked for me in Ubuntu 14.04
I'm new to laravel and am currently stuck when trying to send an email like this:
Mail::send('emails.pwreset', $mydata, function ($message) use ($mydata) {
$message->from('foo#bar.de', 'Password reset');
how can I enable/configure the mailing function?
here's my laravel error message:
Swift_TransportException in StreamBuffer.php line 294: Process could not be started [Das System kann den angegebenen Pfad nicht finden.
]
in StreamBuffer.php line 294
at Swift_Transport_StreamBuffer->_establishProcessConnection() in StreamBuffer.php line 58
at Swift_Transport_StreamBuffer->initialize(array('timeout' => '30', 'blocking' => '1', 'command' => '/usr/sbin/sendmail -bs', 'type' => '16')) in AbstractSmtpTransport.php line 113
at Swift_Transport_AbstractSmtpTransport->start() in SendmailTransport.php line 51
at Swift_Transport_SendmailTransport->start() in Mailer.php line 79
at Swift_Mailer->send(object(Swift_Message), array()) in Mailer.php line 398
at Mailer->sendSwiftMessage(object(Swift_Message)) in Mailer.php line 188
at Mailer->send('emails.pwreset', array('passwort' => 'WVSSV', 'empf' => 'foo#bar.de'), object(Closure)) in Facade.php line 216
at Facade::__callStatic('send', array('emails.pwreset', array('passwort' => 'WVSSV', 'empf' => 'foo#bar.de'), object(Closure))) in ResetpwController.php line 58
at Mail::send('emails.pwreset', array('passwort' => 'WVSSV', 'empf' => 'foo#bar.de'), object(Closure)) in ResetpwController.php line 58
at ResetpwController->resetted(object(Request))
at call_user_func_array(array(object(ResetpwController), 'resetted'), array(object(Request))) in Controller.php line 256
at Controller->callAction('resetted', array(object(Request))) in ControllerDispatcher.php line 164
at ControllerDispatcher->call(object(ResetpwController), object(Route), 'resetted') in ControllerDispatcher.php line 112
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 114
at ControllerDispatcher->callWithinStack(object(ResetpwController), object(Route), object(Request), 'resetted') in ControllerDispatcher.php line 69
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\Resetpw\ResetpwController', 'resetted') in Route.php line 201
at Route->runWithCustomDispatcher(object(Request)) in Route.php line 134
at Route->run(object(Request)) in Router.php line 704
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Router.php line 706
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 671
at Router->dispatchToRoute(object(Request)) in Router.php line 631
at Router->dispatch(object(Request)) in Kernel.php line 236
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 54
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 62
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 122
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87
at Kernel->handle(object(Request)) in index.php line 54
It looks like /usr/sbin/sendmail does not exist. Is sendmail installed and properly configured?
Also check the Swift Mailer settings inside your application.
I a newbie to Laravel. In my project there is a Model called Student and a table in MySQL student.
When I am trying to insert some values to the database using Student::create , it gives me the following errors.
The database table exists and I retrieved some values from another table before.
My Insert Code in the Controller:
Student::create([
'name' => Input::get('student_name'),
'email' => Input::get('student_email',
'contact' => Input::get('student_tel'),
'reg_id' => Input::get('registration_no'),
'password' => Hash::make(Input::get('password'))
]);
My Model Class:
<?php namespace App;
use Illuminate\Database\Eloquent\Model;
class Student extends Model {
protected $table = 'student';
protected $fillable = ['name', 'email', 'contact', 'username', 'password'];
}
Complete Error for QueryException
QueryException in Connection.php line 620: SQLSTATE[42S02]: Base table
or view not found: 1146 Table 'msc_project.tablename' doesn't exist
(SQL: select count(*) as aggregate from tablename where
registration_no = asgfsag)
``**in Connection.php line 620
at Connection->runQueryCallback('select count(*) as aggregate from `tablename` where `registration_no` = ?', array('ffhfdh'), object(Closure)) in Connection.php line 576
at Connection->run('select count(*) as aggregate from `tablename` where `registration_no` = ?', array('ffhfdh'), object(Closure)) in Connection.php line 293
at Connection->select('select count(*) as aggregate from `tablename` where `registration_no` = ?', array('ffhfdh'), true) in Builder.php line 1377
at Builder->runSelect() in Builder.php line 1367
at Builder->getFresh(array('*')) in Builder.php line 1354
at Builder->get(array('*')) in Builder.php line 1636
at Builder->aggregate('count', array('*')) in Builder.php line 1574
at Builder->count() in DatabasePresenceVerifier.php line 57
at DatabasePresenceVerifier->getCount('tablename', 'registration_no', 'ffhfdh', null, null, array()) in Validator.php line 1057
at Validator->validateUnique('registration_no', 'ffhfdh', array('tablename'), object(Validator)) in Validator.php line 372
at Validator->validate('registration_no', 'unique:tablename') in Validator.php line 325
at Validator->passes() in Validator.php line 347
at Validator->fails() in StudentController.php line 56
at StudentController->doRegistration()
at call_user_func_array(array(object(StudentController), 'doRegistration'), array()) in Controller.php line 246
at Controller->callAction('doRegistration', array()) in ControllerDispatcher.php line 162
at ControllerDispatcher->call(object(StudentController), object(Route), 'doRegistration') in ControllerDispatcher.php line 107
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 141
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 101
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 108
at ControllerDispatcher->callWithinStack(object(StudentController), object(Route), object(Request), 'doRegistration') in ControllerDispatcher.php line 67
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\StudentController', 'doRegistration') in Route.php line 198
at Route->runWithCustomDispatcher(object(Request)) in Route.php line 131
at Route->run(object(Request)) in Router.php line 691
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 141
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 101
at Pipeline->then(object(Closure)) in Router.php line 693
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 660
at Router->dispatchToRoute(object(Request)) in Router.php line 618
at Router->dispatch(object(Request)) in Kernel.php line 210
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 141
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 43
at VerifyCsrfToken->handle(object(Request), object(Closure)) in VerifyCsrfToken.php line 17
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 55
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 61
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 36
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 40
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 101
at Pipeline->then(object(Closure)) in Kernel.php line 111
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 84
at Kernel->handle(object(Request)) in index.php line 53
at require_once('/home/pranavaghanan/Documents/GitHub Projects/MScApp/public/index.php') in server.php line 21
Complete Error List for PDOException
PDOException in Connection.php line 288: SQLSTATE[42S02]: Base table
or view not found: 1146 Table 'msc_project.tablename' doesn't exist
in Connection.php line 288
at PDO->prepare('select count(*) as aggregate from `tablename` where `registration_no` = ?') in Connection.php line 288
at Connection->Illuminate\Database\{closure}(object(MySqlConnection), 'select count(*) as aggregate from `tablename` where `registration_no` = ?', array('ffhfdh')) in Connection.php line 612
at Connection->runQueryCallback('select count(*) as aggregate from `tablename` where `registration_no` = ?', array('ffhfdh'), object(Closure)) in Connection.php line 576
at Connection->run('select count(*) as aggregate from `tablename` where `registration_no` = ?', array('ffhfdh'), object(Closure)) in Connection.php line 293
at Connection->select('select count(*) as aggregate from `tablename` where `registration_no` = ?', array('ffhfdh'), true) in Builder.php line 1377
at Builder->runSelect() in Builder.php line 1367
at Builder->getFresh(array('*')) in Builder.php line 1354
at Builder->get(array('*')) in Builder.php line 1636
at Builder->aggregate('count', array('*')) in Builder.php line 1574
at Builder->count() in DatabasePresenceVerifier.php line 57
at DatabasePresenceVerifier->getCount('tablename', 'registration_no', 'ffhfdh', null, null, array()) in Validator.php line 1057
at Validator->validateUnique('registration_no', 'ffhfdh', array('tablename'), object(Validator)) in Validator.php line 372
at Validator->validate('registration_no', 'unique:tablename') in Validator.php line 325
at Validator->passes() in Validator.php line 347
at Validator->fails() in StudentController.php line 56
at StudentController->doRegistration()
at call_user_func_array(array(object(StudentController), 'doRegistration'), array()) in Controller.php line 246
at Controller->callAction('doRegistration', array()) in ControllerDispatcher.php line 162
at ControllerDispatcher->call(object(StudentController), object(Route), 'doRegistration') in ControllerDispatcher.php line 107
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 141
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 101
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 108
at ControllerDispatcher->callWithinStack(object(StudentController), object(Route), object(Request), 'doRegistration') in ControllerDispatcher.php line 67
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\StudentController', 'doRegistration') in Route.php line 198
at Route->runWithCustomDispatcher(object(Request)) in Route.php line 131
at Route->run(object(Request)) in Router.php line 691
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 141
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 101
at Pipeline->then(object(Closure)) in Router.php line 693
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 660
at Router->dispatchToRoute(object(Request)) in Router.php line 618
at Router->dispatch(object(Request)) in Kernel.php line 210
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 141
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 43
at VerifyCsrfToken->handle(object(Request), object(Closure)) in VerifyCsrfToken.php line 17
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 55
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 61
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 36
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 40
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 101
at Pipeline->then(object(Closure)) in Kernel.php line 111
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 84
at Kernel->handle(object(Request)) in index.php line 53
at require_once('/home/pranavaghanan/Documents/GitHub Projects/MScApp/public/index.php') in server.php line 21
UPDATE :
I just found out that when comment out the code which is for Validation, the data goes into the database. Any idea why this line is causing the error?
$validator = \Validator::make($postedData, $rules, $messages);
if ($validator->fails()) {
return Redirect::to('registration')->withInput()->withErrors($validator);
}
If I don't use \Validator it doesn't accept the class either.