Example of API with Vue.js in familytree365/backend

File app/Http/Controllers/CompanyController.php (link to Github)
use Illuminate\Http\Request;

class CompanyController extends Controller
{
    public function store(Request $request)
    {
        $user = auth()->user();

        $request->validate([
            'name' => ['required', 'unique:landlord.companies'],
        ]);

        return $user->Company()->create([
            'name' => $request->name,
            'status' => 1,
            'current_tenant' => 0,
        ]);
    }
}
File pages/company/create.vue (link to Github)
<template>
        //
</template>

<script>
        //
        methods: {
            save() {
                this.$v.$touch();
                if (this.$v.$invalid) {
                    console.log("fail")
                } else {
                    this.$axios.$post('/api/company', this.company)
                            .then(response => (this.$router.push('/company')))
                            .catch(error => {
                            });
                }
            },
        }
    }
</script>
File routes/api.php (link to Github)
use Illuminate\Support\Facades\Route;

//
Route::middleware('tenant')->group(function () {
    //
    Route::resource('company', 'CompanyController');
    //
});

Additional resources on API with Vue.js: