logo
down
shadow

Laravel 5.3 Route::get() returns error Class [classname] does not exist


Laravel 5.3 Route::get() returns error Class [classname] does not exist

By : Kamal S. Shekhawat
Date : November 28 2020, 11:01 PM
To fix the issue you can do first run the command composer dump-autoload
If its not work, than follow those steps:
code :
<?php

namespace App\Providers;

use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;

class RouteServiceProvider extends ServiceProvider
{
    /**
     * This namespace is applied to your controller routes.
     *
     * In addition, it is set as the URL generator's root namespace.
     *
     * @var string
     */
    protected $namespace = 'App\Http\Controllers';

    /**
     * Define your route model bindings, pattern filters, etc.
     *
     * @return void
     */
    public function boot()
    {
        //

        parent::boot();
    }

    /**
     * Define the routes for the application.
     *
     * @return void
     */
    public function map()
    {
        $this->mapWebRoutes();

        $this->mapApiRoutes();

        //
    }

    /**
     * Define the "web" routes for the application.
     *
     * These routes all receive session state, CSRF protection, etc.
     *
     * @return void
     */
    protected function mapWebRoutes()
    {
        Route::group([
            'middleware' => 'web',
            'namespace' => $this->namespace,
        ], function ($router) {
            require base_path('routes/web.php');
        });
    }

    /**
     * Define the "api" routes for the application.
     *
     * These routes are typically stateless.
     *
     * @return void
     */
    protected function mapApiRoutes()
    {
        Route::group([
            'middleware' => ['api', 'auth:api'],
            'namespace' => $this->namespace,
            'prefix' => 'api',
        ], function ($router) {
            require base_path('routes/api.php');
        });
    }
}
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;

class SiteController extends Controller
{
    public function index() {
        return view('pages.index');
    }
}


Share : facebook icon twitter icon
Laravel routing returns error: "Class LoginController does not exist"

Laravel routing returns error: "Class LoginController does not exist"


By : user2966522
Date : March 29 2020, 07:55 AM
will help you The problem is that you have put the controller into a namespace (app\controllers)
You either have to remove that or adjust your route:
code :
Route::post('user/new', array(
    'as' => 'create_user',
    'uses' => 'app\controllers\LoginController@store'
));
ReflectionException: Class ClassName does not exist - Laravel

ReflectionException: Class ClassName does not exist - Laravel


By : Laura Sasu
Date : March 29 2020, 07:55 AM
will be helpful for those in need Perform a composer update, then composer dump-autoload.
If the above doesn't solve the problem, change the classmap in your composer.json file such that it contains the project-relative path to your php files:
code :
"autoload-dev": {
    "classmap": [
        "tests/TestCase.php",
        "database/seeds/UserTableSeeder.php" //include the file with its path here
    ]
}, /** ... */
Laravel/ PHP- 404 route returns page that doesn't exist

Laravel/ PHP- 404 route returns page that doesn't exist


By : D H
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further So it turns out this issue was happening because I had missed a couple of the 'parent' routes when setting the URL in the service.ts file... After changing that line from
code :
private preferredAddresseeDetailsUpdateUrl: string = BASE_URL + '/web-api/preferredAddressee';
private preferredAddresseeDetailsUpdateUrl: string = BASE_URL + '/web-api/t/prov/preferredAddressee';
Laravel 6.0 php artisan route:list returns “Target class [App\Http\Controllers\SessionsController] does not exist.”

Laravel 6.0 php artisan route:list returns “Target class [App\Http\Controllers\SessionsController] does not exist.”


By : user3174952
Date : March 29 2020, 07:55 AM
I wish this help you I am using Laravel 6.0 and I try to list all my routes with artisan route:list, but it fails and returns: , Run this command
code :
  php artisan config:cache 
Upgrading from Laravel 5.7 to 5.8 returns error: Class blade.compiler does not exist.... post-autoload-dump event return

Upgrading from Laravel 5.7 to 5.8 returns error: Class blade.compiler does not exist.... post-autoload-dump event return


By : user3239972
Date : March 29 2020, 07:55 AM
I wish this helpful for you The problem was caused by a custom blade directive in the register() method of /App/Providers/AppServiceProvider. Custom Blade directives need to be in the boot() method instead as explained on Laracast discussion
Related Posts Related Posts :
  • Endline after certain number of characters
  • aspnet core app strange request type
  • Loop over one array as if it was a multidimensional array
  • I need to extract number from given strings using php
  • I want some correction on my result using codeigniter
  • Add image to sub-category instead of text link PHP-OPENCART
  • Laravel: return JSON model with relation
  • Combining arrays from config files
  • Php character count without spaces and html tags
  • how to access all array values in php?
  • How to get eBay item URL based on item ID
  • Event broadcating: Laravel Echo fails receiving broadcasts
  • Chrome extension to execute php file
  • PHP update password form not working
  • Behat stopped working SSL error fwrite() laravel
  • If Statements in print to loop new <li>
  • PHP cafile below version 5.6
  • Selecting by two parameters from table
  • simple_array handling with SonataAdminBundle
  • Codeigniter Email Confirmations
  • Why is it i can't display image? i been trying so many different codes but the image still doesn't display
  • Variadic Variables by Reference
  • php :select column in array with Undefined index error
  • Missing composer/zend command: development-enable
  • how to load array response from ajax into array input textbox
  • Reorder WordPress Plugin echo Order On Posts
  • Want to take backup of code in PHP where files which are to be taken as backup is read from another specified (patch)fol
  • MySQL output in PHP tables
  • line 5: Call to undefined function link_to_route()
  • Sql request with php : select posts where there is a youtube link
  • ZF2 - how to use require_once as $this->render?
  • How to run unit testing in cakephp3?
  • Odd behaviour of array_diff
  • CakePHP Virtual Fields send headers?
  • mySQL in server Terminal, need to see output
  • How to get a single data from comma separated array and displaying data of that record using codeigniter php
  • SELECTING Multiple Rows with an Array and then INSERT to another statement
  • Cron and SetTimeZone in PHP file
  • arrays and index php
  • Yii2 - trasitive dependency in active records
  • Is it possible with docker to run more than one app on port 80 on the same computer?
  • How to work with stripe in laravel 5.2
  • Append <figure> tag at the starting and ending of <img> tag in PHP
  • Autofill form data after login
  • php artisan not returning anything
  • array_intersect_key with three array in php
  • PHP / mySQL - prepare and bind locally
  • how to display controller array values in mvc concept?
  • While loop without explicit increment / counter (basic)
  • updated values are displaying only after refreshing the page
  • PHP: update on DB if i pass it through get url
  • Select * from table where columns contain a keyword
  • Wildcard to route to a controller
  • Unknown component ID: authClientCollection
  • make standings table soccer league
  • Laravel pusher error: JSON returned from webapp was invalid, yet status code was 200
  • How to get most downloads records
  • What argument does my function need to echo get_results() query results
  • Laravel - Toggle value in database with checkbox and ajax
  • $_POST is not working in web services?
  • shadow
    Privacy Policy - Terms - Contact Us © soohba.com