Welcome Guest, Not a member yet? Register   Sign In
Run a seeder using a php script, without spark CLI
#3

Hi datamweb,
Many thanks for your instructions, I really appreciate it! I have followed what you wrote but unfortunately I get: 
404 - File Not Found.... Can't find a route for 'home'. 
I also tried Home, home.php, Home.php
I think it's because I followed that tutorial which has custom routes written in Routes.php
Is there a route I could write specifically to allow that Home.php file to be called in the URL?

Here is what's in Routes.php




Code:
$routes->addPlaceholder('slug', '[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*');

// Define routes for /, recipe/id and recipe/slug
$routes->get('/', 'RecipesController::index');
$routes->get('recipe/(:num)', 'RecipesController::recipeById/$1');
$routes->get('recipe/(:slug)', 'RecipesController::recipeBySlug/$1');
I have tried to modify this with no success.  And also placed "return command('dbConfusedeed KishanSeeder');" in the RecipesController.php file (from the tutorial) but it did not add anything to the database when that file got accessed.
Thanks again!
Reply


Messages In This Thread
RE: Run a seeder using a php script, without spark CLI - by Kishan Anand - 04-28-2022, 03:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB