Welcome Guest, Not a member yet? Register   Sign In
Seeding -> Class not found


i used CI 3 before and i liked it a lot and now i want to write a inhouse Solution for my Company. So i thought it would be nice to start  with the new seeding possibilites.

But somehow my seed class cant be found. I even tried the example from the docs and created the SimpleSeeder Class:
PHP Code:
<?php namespace App\Database\Seeds;

SimpleSeeder extends \CodeIgniter\Database\Seeder
       public function run()
               $data = [
                       'username' => 'darth',
                       'email'    => '[email protected]'

               // Using Query Builder

The class is located in app/Database/Seeds/SimpleSeeder.php

And in the example Controller "Home.php" i called the seeder with:
PHP Code:
    public function index()
               $seeder = \Config\Database::seeder();

But every time i call the home Controller ill get the error Message that SimpleSeeder class could not be found. What am i missing here? And yes, i did the configuration for the Database in app/Config/Database.php

Interesting twist: i tried the seeding at home on local xampp and there it worked flawless. But i tried an older Version of CI4. I cant tell u from when this version is, but the most obvious difference is that this version has an "application" directory and not the new "app" directory.

Ive got this feeling that this is a bug.


Instead of calling seeder like this:
PHP Code:

Call it this way:

PHP Code:

(This post was last modified: 03-05-2019, 03:48 AM by jasonzig. Edit Reason: did more research )

Does the path (output of the pwd unix command in terminal from inside your CI folder) have a tilde(~) in it?

There seems to be an issue with that: https://forum.codeigniter.com/thread-72950.html

(Using CodeIgniter since 1.x)

Theme © iAndrew 2016 - Forum software by © MyBB