• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Seeding -> Class not found

#1
Hello,

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;

class 
SimpleSeeder extends \CodeIgniter\Database\Seeder
{
 
       public function run()
 
       {
 
               $data = [
 
                       'username' => 'darth',
 
                       'email'    => 'darth@theempire.com'
 
               ];

 
               // Using Query Builder
 
               $this->db->table('users')->insert($data);
 
       }

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();
 
               $seeder->call('SimpleSeeder');
        return 
view('welcome_message');
    } 

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
Reply


Messages In This Thread
Seeding -> Class not found - by mayo83 - 02-12-2019, 04:46 AM
RE: Seeding -&gt; Class not found - by mayo83 - 02-13-2019, 01:33 AM
RE: Seeding -&gt; Class not found - by mayo83 - 02-20-2019, 04:06 AM
RE: Seeding -> Class not found - by jasonzig - 03-04-2019, 07:08 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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