Target class controller does not exist – Laravel 8

You are using Laravel 8. In a fresh install of Laravel 8, there is no namespace prefix being applied to your route groups that your routes are loaded into. “In previous releases of Laravel, the RouteServiceProvider contained a $namespace property. This property’s value would automatically be prefixed onto controller route definitions and calls to the … Read more

How to use multiple databases in Laravel

Using .env >= 5.0 (Tested on 5.5) (Works on 8) In .env DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=database1 DB_USERNAME=root DB_PASSWORD=secret DB_CONNECTION_SECOND=mysql DB_HOST_SECOND=127.0.0.1 DB_PORT_SECOND=3306 DB_DATABASE_SECOND=database2 DB_USERNAME_SECOND=root DB_PASSWORD_SECOND=secret In config/database.php ‘mysql’ => [ ‘driver’ => env(‘DB_CONNECTION’), ‘host’ => env(‘DB_HOST’), ‘port’ => env(‘DB_PORT’), ‘database’ => env(‘DB_DATABASE’), ‘username’ => env(‘DB_USERNAME’), ‘password’ => env(‘DB_PASSWORD’), ], ‘mysql2’ => [ ‘driver’ => env(‘DB_CONNECTION_SECOND’), ‘host’ … Read more

Laravel 8 – can’t get data from database

What you need is to get all the followers of a user. Let me do the coding for you so that you have a somewhat more standard code than you have now. In you User Model <?php namespace App\Models; use Illuminate\Foundation\Auth\User as Authenticatable; class User extends Authenticatable { /** * The followers that belong to … Read more

define vue application in blade component

You can use one Vue app declaration by HTML container. You can’t use one declared component inside other declared component. So you can do this. <!DOCTYPE HTML> <html lang=”en”> <head> ….. </head> <body> <!– MAYBE YOU CAN DO A BLADE TEMPLATE –> <div id=”navitagion”></div> <div id=”app”></div> <!–=============== scripts ===============–> <script type=”text/javascript” src=”https://stackoverflow.com/questions/53887003/{{asset(“path/to/vue.js’)}}”></script> const app = … Read more