/home error after fresh install laravel 5 - laravel-5

So I just fresh installation of Laravel 5 and manage to go to '/' uri with no problem.
But when I go to 'home' as what being listed in default routes.php, I got this error.
ErrorException in functions.php line 17:
Missing argument 1 for redirect(), called in /Applications/MAMP/htdocs/learning-l5/app/Http/Middleware/Authenticate.php on line 43 and defined
What is wrong?

Related

Laravel not formatting 3rd party package

I've recently set up my Laravel 5.7 project with GIT. I did a clone onto a new computer and ran composer install. I keep getting a syntax error (T_CONSTANT_ENCAPSED_STRING).
I'm using a Upgraded version of Laravel 5.7(started at 5.1). Using the Bican Roles package to manage roles on the site.
I've tried reinstalling and uninstalling the package. Also tried wrapping it with double parentheses. (thats the part not formatting). all to no avail
//before rendering in app.blade.php
#role('admin')
// after rendering
<?php if (Auth::check() && Auth::user()->is'admin'): ?>
Errors I'm getting when trying to load the page.
syntax error, unexpected ''admin'' (T_CONSTANT_ENCAPSED_STRING) (View:
C:\wamp64\www\dashboard\resources\views\app.blade.php) (View:
C:\wamp64\www\dashboard\resources\views\app.blade.php) Previous
exceptions syntax error, unexpected ''admin''
(T_CONSTANT_ENCAPSED_STRING) (View:
C:\wamp64\www\dashboard\resources\views\app.blade.php) (0) syntax
error, unexpected ''admin'' (T_CONSTANT_ENCAPSED_STRING) (0)
This part leads to error: Auth::user()->is'admin'
It should be Auth::user()->is('admin'). You should check the code where the Blade directive #role is defined.

Laravel 5.1 NotFoundHttpException in RouteCollection.php line 161

I have an error which you can see in this picture, and I don't know how to fix it. I am using Laravel 5.1.
Error:
Sorry, the page you are looking for could not be found.
NotFoundHttpException in RouteCollection.php line 161
Either make your route something like in your Routes.php file from App\Http folder
Route::get('/laravel/alert/',function(){
//statement here
});
or change your page url to localhost/alert
Hope it will help you.
happyCoding
Assuming you Apache configuration is already pointed to your public folder in your project folder as DocumentRoot, it should able to work by accessing this route:
localhost/alert
I noted you use localhost/laravel/alert which looks wrong because you set your route to be /alert not laravel/alert
If you are not sure this is Apache or Laravel issue, run php artisan serve on the project folder and access the routes with this address, localhost:8000/alert

Laravel 5 cache folder name causing classloader.php 412 error

When I uploaded my laravel 5 application to hostgator, i changed the name of one of the folders (instructor) that contains some controllers to (Instructors). However, I'm getting the error ErrorException in ClassLoader.php line 412
the applications is looking for controllers under the old folder name (instructor).
How can i fix this issue please?
Thank you
You can run the following command:
composer dumpautoload
perhaps u don't have controller.php file in the controllers folder under http folder of ur project.
Look for this file first..because in this file controller itself gets extended from basecontroller class, therefore it is necessary that this file should be there.

Laravel new command error

I did the following commands:
composer global require "laravel/installer=~1.1"
and
set PATH=%PATH%;%USERPROFILE%\AppData\Roaming\Composer\vendor\bin
But when I try to do:
laravel new blog
I get the following error:
Notice: Undefined variable: output in C:\Users\****\AooDara\Roaming\Composer\vendor\laravel\installer\src\NewCommand.php on line 55
Fatal error: Call to a member function writeln() on null in C:\Users\****\AooDara\Roaming\Composer\vendor\laravel\installer\src\NewCommand.php on line 55
Any idea of what went wrong?
Seems like you already have a directory called 'blog' in your application directory. Try creating a laravel app with different name or delete / rename existing 'blog' directory and try again.
for example laravel new helloapp.
However, I think the error showing at the console is a bug of laravel new command. I could see the error at the console when I tried to create a app with same name again from same directory.
The error not exists now. Try creating other application.

Deploying Laravel 4 on hosting server

I have a problem deploying Laravel 4 on hosting server (hostgator). I have uploaded all files to the server. Current PHP version is 5.3.24 and I have followed all the instructions on four.laravel.com/docs/installation.
I get following error:
Fatal error: Call to a member function run() on a non-object in /home3/varoid/public_html/index.php on line 51
If you look at the index.php in your public_html folder, you'll see it calls $app->run(). Since run isn't defined, $app is probably not available. On line 35 the $app is set like this:
$app = require_once __DIR__.'/../bootstrap/start.php';
It doesn't work for you, so this means the start.php could not be found. Maybe you placed it elsewhere than the default path? In case you didn't know __DIR__ means, the current dir (public_html). Just make sure the file exists and try again!

Resources