Laravel InvalidArgumentException - php

hi all im having issue with a script i am helping a friend install
InvalidArgumentException in FileViewFinder.php line 137:
View [admin.cms] not found.
in FileViewFinder.php line 137
at FileViewFinder->findInPaths('admin.cms', array('/volume1/web/resources/views')) in FileViewFinder.php line 79
at FileViewFinder->find('admin.cms') in Factory.php line 174
at Factory->make('admin.cms', array('data' => ''), array()) in helpers.php line 858
at view('admin.cms', array('data' => '')) in CmsController.php line 70
at CmsController->dashboard()
at call_user_func_array(array(object(CmsController), 'dashboard'), array()) in Controller.php line 55
at Controller->callAction('dashboard', array()) in ControllerDispatcher.php line 44
at ControllerDispatcher->dispatch(object(Route), object(CmsController), 'dashboard') in Route.php line 189
at Route->runController() in Route.php line 144
at Route->run(object(Request)) in Router.php line 653
at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in RedirectIfNotCms.php line 24
at RedirectIfNotCms->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckLanguage.php line 27
at CheckLanguage->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Authenticate.php line 43
at Authenticate->handle(object(Request), object(Closure), 'cms') in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Router.php line 655
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 629
at Router->dispatchToRoute(object(Request)) in Router.php line 607
at Router->dispatch(object(Request)) in Kernel.php line 268
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Debugbar.php line 51
at Debugbar->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Kernel.php line 150
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 117
at Kernel->handle(object(Request)) in index.php line 53
at fileviewfinder.php 137
protected function findInPaths($name, $paths)
{
foreach ((array) $paths as $path) {
foreach ($this->getPossibleViewFiles($name) as $file) {
if ($this->files->exists($viewPath = $path.'/'.$file)) {
return $viewPath;
}
}
}
throw new InvalidArgumentException("View [$name] not found.");
}
/**
Im not sure what issue is i have checked that the paths are correct.
any help or a point in direction would be greatly appreciated
Server is Running Apache 2.4 and php version 7.2 Im not sure what issue is i have checked that the paths are correct.
any help or a point in direction would be greatly appreciated
Server is Running Apache 2.4 and php version 7.2

Make sure that your view file is in resources folder, and it got .blade.php as extension.
you can do this as well dd(view()->exists($yourview)); it should return true if the view exists, false if not.
Start from there and you will get to the solution.

Related

View [welcome] not found

I deployed my Laravel app (with Cloud SQL integration) onto Google App Engine with the following settings.
app.yaml
runtime: php73
env_variables:
LOG_CHANNEL: stackdriver
APP_LOG: errorlog
APP_KEY: [APP KEY]
APP_URL: "http://example.com/"
APP_STORAGE: /tmp
VIEW_COMPILED_PATH: /tmp
CACHE_DRIVER: database
SESSION_DRIVER: database
DB_DATABASE: cbt-sql
DB_USERNAME: root
DB_PASSWORD: [PASSWORD]
DB_SOCKET: "[SOCKET DETAILS]"
I ran the usual config/cache/view/route clear commands.
Using gcloud beta app deploy --no-cache, I got the following error:
View [welcome] not found.
However, looking at my codes directory, the view is clearly there.
What did I do wrong?
(1/1) InvalidArgumentException
View [welcome] not found.
in FileViewFinder.php line 137
at FileViewFinder->findInPaths('welcome', array('/workspace/resources/views'))
in FileViewFinder.php line 79
at FileViewFinder->find('welcome')
in Factory.php line 131
at Factory->make('welcome', array(), array())
in helpers.php line 975
at view('welcome')
in WelcomeController.php line 14
at WelcomeController->index()
at call_user_func_array(array(object(WelcomeController), 'index'), array())
in Controller.php line 54
at Controller->callAction('index', array())
in ControllerDispatcher.php line 45
at ControllerDispatcher->dispatch(object(Route), object(WelcomeController), 'index')
in Route.php line 219
at Route->runController()
in Route.php line 176
at Route->run()
in Router.php line 680
at Router->Illuminate\Routing\{closure}(object(Request))
in Pipeline.php line 130
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in VerifyCsrfToken.php line 76
at VerifyCsrfToken->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in StartSession.php line 56
at StartSession->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in EncryptCookies.php line 66
at EncryptCookies->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 105
at Pipeline->then(object(Closure))
in Router.php line 682
at Router->runRouteWithinStack(object(Route), object(Request))
in Router.php line 657
at Router->runRoute(object(Request), object(Route))
in Router.php line 623
at Router->dispatchToRoute(object(Request))
in Router.php line 612
at Router->dispatch(object(Request))
in Kernel.php line 176
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
in Pipeline.php line 130
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in TransformsRequest.php line 21
at TransformsRequest->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in TransformsRequest.php line 21
at TransformsRequest->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in ValidatePostSize.php line 27
at ValidatePostSize->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in CheckForMaintenanceMode.php line 62
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in TrustProxies.php line 57
at TrustProxies->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 105
at Pipeline->then(object(Closure))
in Kernel.php line 151
at Kernel->sendRequestThroughRouter(object(Request))
in Kernel.php line 116
at Kernel->handle(object(Request))
in index.php line 59
[1]: https://i.stack.imgur.com/byOzf.png
FileViewFinder->findInPaths('welcome', array('/workspace/resources/views'))
Check your path

Trying to get property of non-object laravel bogardo/mailgun/src/http/response

This error appears when I try to send email with mailgun package for laravel (bogardo/mailgun).
Route:
Route::post('mail-list/send/{type}/{id}', ['uses' => 'MailingList\MailingListController#sendSiteNews', 'as' => 'mail-list.send']);
Controller MailingListController
use Bogardo\Mailgun\Mail\Message;
use Mailgun;
Controller method:
public function sendSiteNews($type, $id) {
$data = [];
Mailgun::send('email.batch-news', $data, function (Message $message) {
$message->to('foo#example.com', 'John Smith')->subject('Welcome!');
});
];
At first I've tried batch sending. Result was the same. After that I've tried to send simple message like above.
view email.batch-news contains only text with h1 tag.
Error message:
ErrorException in Response.php line 35:
Trying to get property of non-object
in Response.php line 35
at HandleExceptions->handleError(8, 'Trying to get property of non-object', 'D:\\wamp\\www\\asiacrochet\\vendor\\bogardo\\mailgun\\src\\Http\\Response.php', 35, array('response' => object(stdClass))) in Response.php line 35
at Response->__construct(object(stdClass)) in Mailer.php line 68
at Mailer->send('email.batch-news', array(), object(Closure)) in Service.php line 59
at Service->send('email.batch-news', array(), object(Closure)) in Facade.php line 221
at Facade::__callStatic('send', array('email.batch-news', array(), object(Closure))) in MailingListController.php line 67
at MailingListController->sendSiteNews('Lesson', '10')
at call_user_func_array(array(object(MailingListController), 'sendSiteNews'), array('Lesson', '10')) in Controller.php line 55
at Controller->callAction('sendSiteNews', array('Lesson', '10')) in ControllerDispatcher.php line 44
at ControllerDispatcher->dispatch(object(Route), object(MailingListController), 'sendSiteNews') in Route.php line 203
at Route->runController() in Route.php line 160
at Route->run() in Router.php line 559
at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 30
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in HasRole.php line 24
at HasRole->handle(object(Request), object(Closure), 'administrator') in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Authenticate.php line 43
at Authenticate->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in Router.php line 561
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 520
at Router->dispatchToRoute(object(Request)) in Router.php line 498
at Router->dispatch(object(Request)) in Kernel.php line 174
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 30
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in TransformsRequest.php line 30
at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in TransformsRequest.php line 30
at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 47
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in Kernel.php line 149
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
at Kernel->handle(object(Request)) in index.php line 53
That is method of package:
public function __construct(stdClass $response)
{dd($response->http_response_body);
$this->status = $response->http_response_code;
$this->message = $response->http_response_body->message;
$this->id = property_exists($response->http_response_body, 'id') ? $response->http_response_body->id : '';
$this->data = null;
}
dd($response->http_response_body);
gives only that string value "Mailgun Magnificent API".
So that is the problem.
Check your send-domain "email.batch-news". If this is incorrect mailgun, does identify the API method you are calling.

Redirect with parameters laravel 5.3 | InvalidArgumentException in Response.php line 462

Hi I'm new to laravel and got stuck.
in my app there are three types of users. their login data is kept in a single table(users table generated with auth), with a char to define the user type. What I want to do is when they log in, redirect them to relevant page with their user_id (obtained from the users table) on the url.
bottomline is I want to get the url as
localhost:8000/ESProfile/15
where value 15 is the user_id of the table.
What I've done so far is below.
In AuthenticatesUsers.php (auto generated from artisan auth)
protected function authenticated(Request $request, $user)
{
$userId = $user->id;
if($user->type === 's') {
return redirect('ESProfile', $userId);
}
else if($user->type === 'p') {
return redirect('/ePProfile');
}
else if($user->type === 'i') {
return redirect('/ePDashboard');
}
}
In web.php
Route::get('ESProfile/{id}', function($id){ return view('ESeeker.details')->with('$id'); });
when I try to login, it gives
InvalidArgumentException in UrlGenerator.php line 314: Route [ESProfile] not defined. error.
along with
in UrlGenerator.php line 314
at UrlGenerator->route('ESProfile', array('15'), true) in helpers.php line 692
at route('ESProfile', array('15')) in AuthenticatesUsers.php line 123
at LoginController->authenticated(object(Request), object(User)) in AuthenticatesUsers.php line 107
at LoginController->sendLoginResponse(object(Request)) in AuthenticatesUsers.php line 46
at LoginController->login(object(Request))
at call_user_func_array(array(object(LoginController), 'login'), array(object(Request))) in Controller.php line 55
at Controller->callAction('login', array(object(Request))) in ControllerDispatcher.php line 44
at ControllerDispatcher->dispatch(object(Route), object(LoginController), 'login') in Route.php line 190
at Route->runController() in Route.php line 144
at Route->run(object(Request)) in Router.php line 642
at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in RedirectIfAuthenticated.php line 24
at RedirectIfAuthenticated->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Router.php line 644
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 618
at Router->dispatchToRoute(object(Request)) in Router.php line 596
at Router->dispatch(object(Request)) in Kernel.php line 267
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Kernel.php line 149
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
at Kernel->handle(object(Request)) in index.php line 54
at require_once('C:\xampp\htdocs\Project\public\index.php') in server.php line 21
Thanks in advance.
In your view, you must be using following code
route('ESProfile', ['id' => $id])
which will obviously fail because you have not defined ESProfile anywhere.
Change your route to following to wrok:
Route::get('ESProfile/{id}', function($id) {
return view('ESeeker.details')->with('$id');
})->name('ESProfile');
Check docs for named routes.
After many trials found my answer.
In RegistersUsers.php (auto generated file from php artisan make:auth)
public function register(Request $request){
$this->validator($request->all())->validate();
event(new Registered($user = $this->create($request->all())));
$this->guard()->login($user);
$user = $request -> user();
if(($user->type) == 's'){
return $this->registered($request, $user)?: redirect()-> intended('/addPreferences/ESId='.$user->id);
}
if(($user->type) == 'p'){
return $this->registered($request, $user)?: redirect()-> intended('/ePProfile/epID='.$user->id);
}
}
appending desired path with intended method did the trick. Thanks.
(special thanks goes to iCode)

Laravel 5.3 update row returns Call to a member function update() on null

I ran into a problem with updating a row in my database. As soon as I submit my update form it return and error Call to a member function update() on null Can someone tell me what I'm doing wrong here?
My code:
public function update(Request $request){
$user = Auth::user();
$uid = $user->farmTag;
$cowValues = array(
'KilledOn' => $request['KilledOn'],
'EID' => $request['EID'],
'ManagementI/D' => $request['ManagementID'],
'name' => $request['name'],
'breed' => $request['breed'],
'sex' => $request['sex'],
'DOB' => $request['DOB'],
'BoughtOn' => $request['BoughtOn'],
'description' => $request['description'],
'farmTag' => $uid,
);
Cow::find($request['EID'])->update($cowValues);
return back();
}
Full error:
in CowsController.php line 280
at CowsController->update(object(Request))
at call_user_func_array(array(object(CowsController), 'update'), array(object(Request))) in compiled.php line 9355
at Controller->callAction('update', array(object(Request))) in compiled.php line 9382
at ControllerDispatcher->dispatch(object(Route), object(CowsController), 'update') in compiled.php line 8440
at Route->runController() in compiled.php line 8421
at Route->run(object(Request)) in compiled.php line 8117
at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 9948
at SubstituteBindings->handle(object(Request), object(Closure)) in compiled.php line 9840
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Authenticate.php line 43
at Authenticate->handle(object(Request), object(Closure)) in compiled.php line 9840
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 3121
at VerifyCsrfToken->handle(object(Request), object(Closure)) in compiled.php line 9840
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 13430
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in compiled.php line 9840
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 11874
at StartSession->handle(object(Request), object(Closure)) in compiled.php line 9840
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 13176
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in compiled.php line 9840
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 13113
at EncryptCookies->handle(object(Request), object(Closure)) in compiled.php line 9840
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 9825
at Pipeline->then(object(Closure)) in compiled.php line 8118
at Router->runRouteWithinStack(object(Route), object(Request)) in compiled.php line 8109
at Router->dispatchToRoute(object(Request)) in compiled.php line 8100
at Router->dispatch(object(Request)) in compiled.php line 2446
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 3183
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in compiled.php line 9840
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 9825
at Pipeline->then(object(Closure)) in compiled.php line 2390
at Kernel->sendRequestThroughRouter(object(Request)) in compiled.php line 2374
at Kernel->handle(object(Request)) in index.php line 53
If there's some missing information, please let me know.
Thanks!
Try this
$cow = Cow::where('EID', $request->input('EID'))->first();
if($cow)
{
$cow->update($cowValues);
}

Error with Laravel file system after moving to new domain and hosting

So i have just run php composer.phar remove and the php composer.phar install and then artisan migrate after moving my site from one domain to another and changing database. This all went ok and no error appeared that i wasnt able to quickly fix that why i ran the composer remove. However im getting a weird cant find file error which i havent had before. I am not sure how to fix this or where i am going wrong. This is the error I am getting:
ErrorException in Filesystem.php line 109:
file_put_contents(/dfb46d0b690f78222831518b7c4c56c1dcef9f3b.php): failed to open stream: Permission denied
in Filesystem.php line 109
at HandleExceptions->handleError('2', 'file_put_contents(/dfb46d0b690f78222831518b7c4c56c1dcef9f3b.php): failed to open stream: Permission denied', '/home/danielma/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php', '109', array('path' => '/dfb46d0b690f78222831518b7c4c56c1dcef9f3b.php', 'contents' => '<?php $__env->startSection('content'); ?> <?php $__env->stopSection(); ?> <?php echo $__env->make('templates.' . $config->currentTemplate . '.standardLayouts.main', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>', 'lock' => false))
at file_put_contents('/dfb46d0b690f78222831518b7c4c56c1dcef9f3b.php', '<?php $__env->startSection('content'); ?> <?php $__env->stopSection(); ?> <?php echo $__env->make('templates.' . $config->currentTemplate . '.standardLayouts.main', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>', '0') in Filesystem.php line 109
at Filesystem->put('/dfb46d0b690f78222831518b7c4c56c1dcef9f3b.php', '<?php $__env->startSection('content'); ?> <?php $__env->stopSection(); ?> <?php echo $__env->make('templates.' . $config->currentTemplate . '.standardLayouts.main', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>') in BladeCompiler.php line 116
at BladeCompiler->compile('/home/danielma/public_html/resources/views/welcome.blade.php') in CompilerEngine.php line 51
at CompilerEngine->get('/home/danielma/public_html/resources/views/welcome.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'config' => object(stdClass))) in View.php line 149
at View->getContents() in View.php line 120
at View->renderContents() in View.php line 85
at View->render() in Response.php line 53
at Response->setContent(object(View)) in Response.php line 201
at Response->__construct(object(View)) in Router.php line 1085
at Router->prepareResponse(object(Request), object(View)) 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(MainController), object(Route), object(Request), 'homePage') in ControllerDispatcher.php line 54
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\MainController', 'homePage') 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
at require_once('/home/danielma/public_html/public/index.php') in index.php line 21
I am not sure where i have gone wrong so help would be greatly appreciated.
These are my current php setting: http://imgur.com/Yuv9UO4
Make sure the storage and bootstrap/cache folders have write permissions.
If you still get the error afterwards run php artisan view:clear and php artisan cache:clear.
From the docs under Installation > Configuration > Directory Permissions:
After installing Laravel, you may need to configure some permissions. Directories within the storage and the bootstrap/cache directories should be writable by your web server or Laravel will not run.
Also check to make sure your .env file is correct.

Categories