Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rotaercz's avatar

Some questions about Laravel Spark

  1. Are these the correct folders to be working in?

    Routes:

     E:\Projects\Vagrant\Homestead\Laravel\routes\
     web.php
     
     E:\Projects\Vagrant\Homestead\Laravel\vendor\laravel\spark\src\Http\
     routes.php
     
    

    Models (I'm pretty sure this is incorrect but I'm not sure what folder I'm supposed to put my models in):

     E:\Projects\Vagrant\Homestead\Laravel\vendor\laravel\framework\src\Illuminate\Database\Eloquent\
     
    

    Controllers:

     E:\Projects\Vagrant\Homestead\Laravel\app\Http\Controllers\
     E:\Projects\Vagrant\Homestead\Laravel\vendor\laravel\spark\src\Http\Controllers\
     
    

    Middleware:

     E:\Projects\Vagrant\Homestead\Laravel\app\Http\Middleware\
     E:\Projects\Vagrant\Homestead\Laravel\vendor\laravel\spark\src\Http\Middleware\
     
    

    Views:

     E:\Projects\Vagrant\Homestead\Laravel\resources\views\vendor\spark\
     E:\Projects\Vagrant\Homestead\Laravel\resources\views\vendor\spark\layouts\
    
  1. Are there any other folders that I should keep in mind?
  1. When using Elixir, are the following paths the correct place to be working in? The reason I ask is, if there is another folder that I should be working in, I worry that when the files are minified and placed in these folders from the other folder I would lose everything I've worked on.

    JS:

     E:\Projects\Vagrant\Homestead\Laravel\public\js\
     
    

    CSS:

     E:\Projects\Vagrant\Homestead\Laravel\public\css\
     
    
  1. What is the right way to remove the notifications/announcements functionality? I understand I can just modify the view file though I'm guessing that's probably not the right way to go about it. What is the correct way to remove (and modify) functionality that I don't want to use?
  1. How can I remove the 'subscription' part so there is no 'free trial' period and the user can use the site indefinitely?
  1. Basically I'm working on setting up an online store that has listed products. Similar to Etsy or Ebay. What files should I be looking at to understand the overall flow of how the payment system is setup in Spark?
0 likes
5 replies
ejdelmonico's avatar

In short, you don't do anything in the vagrant vm except artisan commands if you don't have it setup to run artisan locally. Everything is done in the project directory on your system, including gulp, yarn, composer, phpunit, etc. Homestead will sync the project files with those in the vm (Homestead.yaml defines the sync folders).

This goes for all project path references as well, including elixir.

Subscriptions is the only reason to use Spark. To remove free trials, just comment out

//        Spark::useStripe()->noCardUpFront()->trialDays(10);
//
//        Spark::freePlan()
//            ->features([
//                'First', 'Second', 'Third'
//            ]);

in the SparkServiceProvider...in the booted() method (where you put your new plans).

Spark is built on top of Cashier, I would look mostly at the Cashier docs and then Spark docs. Other than that, Jeffrey has a few videos and poking around the code. Spark was not at all designed for an online store, just subscriptions. It is highly integrated with Bootstrap and very, very opinionated.

1 like
ejdelmonico's avatar

Spark is different than regular Laravel install. Spark is installed in a sub-directory called spark and most of the things you need are copied over to the resources folder. SparkServiceProvider should be in the Providers directory.

https://cl.ly/iX7F

1 like
rotaercz's avatar

@martinbean There's 2 vendor directories and no way to modify the Spark files then?

Are you really sure because there's a vendor directory in the /Homestead folder and another in the /Homestead/Laravel folder. I think the real vendor files are the ones in the /Homestead/vendor folder while I'm supposed to edit the files in the /Homestead/Laravel/vendor folder

clay's avatar

Post a screenshot of your directory structure. Don't modify vendor files. The spark docs show how to make modifications. If you need to change functionality, you can use Spark::swap. In your views folder, there is a vendor folder. You can modify these views if necessary and when you update spark, it will check to see which views you modified and not update those. Personally, I Use javascript to make small modifications to my spark views, just so I don't have to touch them.

Please or to participate in this conversation.