Installation
composer require companyos/backend
php bin/console backend:install
First Use Case: Dashboard
/admin to see the pre-built dashboard.Where to Look First
config/packages/companyos_backend.yaml: Core configuration (e.g., API endpoints, theme defaults).assets/: VueJS + CoreUI source files (modify here for customization).templates/: Twig templates for server-side rendering (e.g., login page).companyos/core-bundle) via Axios.
// Example: assets/js/api.js
import axios from 'axios';
const api = axios.create({
baseURL: '/api', // Configured in backend.yaml
});
export default api;
src/Controller/AdminController).api.js instance above.ref or reactive to manage state.# config/packages/companyos_backend.yaml
companyos_backend:
admin:
routes:
- { path: '/users', component: 'Users', icon: 'cil-user' }
assets/js/pages/ (e.g., Users.vue).webpack.config.js to ensure assets are bundled correctly.// assets/scss/coreui/_variables.scss
$theme-colors: (
'primary': #4e73df,
'danger': #fd7e14
);
_variables.scss in your project.npm run dev
// assets/js/store/auth.js
import { createStore } from 'vuex';
export default createStore({
state: { user: null },
mutations: {
SET_USER(state, user) { state.user = user; },
},
});
EventDispatcher./admin after login (configure in security.yaml).Asset Pipeline Issues
npm install or npm run dev after modifying assets/.webpack.config.js is configured to watch your project’s assets/ directory.API Endpoint Mismatches
baseURL from backend.yaml (injected via Twig or Webpack).Vue 3 + Symfony Twig Conflicts
v-bind or v-on without proper escaping.{{ app.importmap }} to avoid conflicts:
{# templates/base.html.twig #}
<script src="{{ asset('js/app.js') }}" type="module"></script>
Plugin System (Alpha Limitation)
EventDispatcher to trigger custom events for extensibility.WebProfilerBundle to debug API calls and Twig rendering.Custom Components
assets/js/coreui/ directory.Card.vue with your version.Webpack Overrides
webpack.config.js to add custom loaders or plugins:
module.exports = {
// ...
plugins: [
new VueLoaderPlugin(),
new MiniCssExtractPlugin(),
],
};
API Response Handling
// assets/js/plugins/api-error-handler.js
export default {
install(app) {
app.config.globalProperties.$handleApiError = (error) => {
// Custom logic (e.g., show toast)
};
},
};
How can I help you explore Laravel packages today?