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

toneee's avatar

Simple Application Tutorials

Hi,

Are there any simple Spark tutorials to create simple applications? I have taken a look at the demo app, but it isnt clear to me how it all hooks together.

Thanks!

0 likes
3 replies
toneee's avatar

Hi @Ftoi, I have but I would like an example of adding some sort of form data, posting to DB and reading out in the correct way.

toneee's avatar

So I have started from the beginning and gone through the tutorial for spark again. It all makes sense. When I get to the API part I just can not make it work.

home.js

Vue.component('home', {
    props: ['user'],

    ready() {
        this.$http.get('/api/test')
            .then(response => {
                console.log(response.data);
            });
    }
});

api.php

Route::group([
    'middleware' => 'auth:api'
], function () {

    Route::get('/test', function() {
        return ['name' => 'John Smith'];
    });
});

I then refresh the page and dont get any console output. What am I missing?

Please or to participate in this conversation.