• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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:

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)

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.