├── README.md
├── admin
├── .gitignore
├── .vscode
│ └── extensions.json
├── README.md
├── index.html
├── package-lock.json
├── package.json
├── postcss.config.js
├── public
│ └── favicon.ico
├── src
│ ├── App.vue
│ ├── assets
│ │ ├── base.css
│ │ ├── logo.svg
│ │ └── main.css
│ ├── components
│ │ ├── Dashboard.vue
│ │ ├── DashboardCard.vue
│ │ ├── Login.vue
│ │ ├── MainContent.vue
│ │ ├── NotFound.vue
│ │ ├── Stats.vue
│ │ ├── __tests__
│ │ │ └── HelloWorld.spec.js
│ │ ├── api
│ │ │ └── index.js
│ │ ├── attendees
│ │ │ ├── AddAttendee.vue
│ │ │ ├── Attendee.vue
│ │ │ └── EditAttendee.vue
│ │ ├── events
│ │ │ ├── AddEvent.vue
│ │ │ ├── EditEvent.vue
│ │ │ └── Event.vue
│ │ ├── icons
│ │ │ ├── IconCommunity.vue
│ │ │ ├── IconDocumentation.vue
│ │ │ ├── IconEcosystem.vue
│ │ │ ├── IconSupport.vue
│ │ │ └── IconTooling.vue
│ │ ├── layout
│ │ │ ├── SideBar.vue
│ │ │ └── TopBar.vue
│ │ └── users
│ │ │ ├── Profile.vue
│ │ │ ├── Register.vue
│ │ │ └── User.vue
│ ├── index.css
│ ├── main.js
│ ├── router
│ │ └── index.js
│ ├── stores
│ │ ├── authStore.js
│ │ └── counter.js
│ ├── utils
│ │ └── index.js
│ └── views
│ │ ├── DashboardView.vue
│ │ ├── LoginView.vue
│ │ ├── NotFoundView.vue
│ │ ├── attendees
│ │ ├── AddAttendeeView.vue
│ │ ├── AttendeeView.vue
│ │ └── EditAttendeeView.vue
│ │ ├── events
│ │ ├── AddEventView.vue
│ │ ├── EditEventView.vue
│ │ └── EventView.vue
│ │ └── users
│ │ ├── ProfileView.vue
│ │ ├── RegisterView.vue
│ │ └── UserView.vue
├── tailwind.config.js
├── vite.config.mjs
└── vitest.config.js
├── api
├── .editorconfig
├── .env.example
├── .gitattributes
├── .gitignore
├── .styleci.yml
├── README.md
├── app
│ ├── Console
│ │ └── Kernel.php
│ ├── Exceptions
│ │ └── Handler.php
│ ├── Helpers
│ │ └── UploadImage.php
│ ├── Http
│ │ ├── Controllers
│ │ │ ├── AttendeeController.php
│ │ │ ├── Auth
│ │ │ │ └── AuthController.php
│ │ │ ├── AuthController.php
│ │ │ ├── Controller.php
│ │ │ ├── EventController.php
│ │ │ ├── PaymentController.php
│ │ │ ├── TicketController.php
│ │ │ └── UserController.php
│ │ ├── Kernel.php
│ │ └── Middleware
│ │ │ ├── Authenticate.php
│ │ │ ├── EncryptCookies.php
│ │ │ ├── PreventRequestsDuringMaintenance.php
│ │ │ ├── RedirectIfAuthenticated.php
│ │ │ ├── SanctumAuthenticate.php
│ │ │ ├── TrimStrings.php
│ │ │ ├── TrustHosts.php
│ │ │ ├── TrustProxies.php
│ │ │ └── VerifyCsrfToken.php
│ ├── Models
│ │ ├── Attendee.php
│ │ ├── Event.php
│ │ ├── Payment.php
│ │ ├── Ticket.php
│ │ └── User.php
│ └── Providers
│ │ ├── AppServiceProvider.php
│ │ ├── AuthServiceProvider.php
│ │ ├── BroadcastServiceProvider.php
│ │ ├── EventServiceProvider.php
│ │ └── RouteServiceProvider.php
├── artisan
├── bootstrap
│ ├── app.php
│ └── cache
│ │ └── .gitignore
├── composer.json
├── composer.lock
├── config
│ ├── app.php
│ ├── auth.php
│ ├── broadcasting.php
│ ├── cache.php
│ ├── cors.php
│ ├── database.php
│ ├── filesystems.php
│ ├── hashing.php
│ ├── logging.php
│ ├── mail.php
│ ├── queue.php
│ ├── sanctum.php
│ ├── services.php
│ ├── session.php
│ └── view.php
├── database
│ ├── .gitignore
│ ├── factories
│ │ └── UserFactory.php
│ ├── migrations
│ │ ├── 2014_10_12_000000_create_users_table.php
│ │ ├── 2014_10_12_100000_create_password_resets_table.php
│ │ ├── 2019_08_19_000000_create_failed_jobs_table.php
│ │ ├── 2019_12_14_000001_create_personal_access_tokens_table.php
│ │ ├── 2023_07_12_134943_create_attendees_table.php
│ │ ├── 2023_07_12_135138_create_events_table.php
│ │ ├── 2024_03_03_082941_create_payments_table.php
│ │ └── 2024_03_10_104226_create_tickets_table.php
│ └── seeders
│ │ └── DatabaseSeeder.php
├── package.json
├── phpunit.xml
├── public
│ ├── .htaccess
│ ├── favicon.ico
│ ├── index.php
│ ├── robots.txt
│ └── uploads
│ │ └── events
│ │ ├── 1706354060_65b4e58cbbaeb.jpg
│ │ └── 1706433566_65b61c1ed238f.png
├── resources
│ ├── css
│ │ └── app.css
│ ├── js
│ │ ├── app.js
│ │ └── bootstrap.js
│ ├── lang
│ │ └── en
│ │ │ ├── auth.php
│ │ │ ├── pagination.php
│ │ │ ├── passwords.php
│ │ │ └── validation.php
│ └── views
│ │ └── welcome.blade.php
├── routes
│ ├── api.php
│ ├── channels.php
│ ├── console.php
│ └── web.php
├── server.php
├── storage
│ ├── app
│ │ ├── .gitignore
│ │ └── public
│ │ │ └── .gitignore
│ ├── framework
│ │ ├── .gitignore
│ │ ├── cache
│ │ │ ├── .gitignore
│ │ │ └── data
│ │ │ │ └── .gitignore
│ │ ├── sessions
│ │ │ └── .gitignore
│ │ ├── testing
│ │ │ └── .gitignore
│ │ └── views
│ │ │ └── .gitignore
│ └── logs
│ │ └── .gitignore
├── tests
│ ├── CreatesApplication.php
│ ├── Feature
│ │ └── ExampleTest.php
│ ├── TestCase.php
│ └── Unit
│ │ └── ExampleTest.php
└── webpack.mix.js
└── landing
├── .gitignore
├── .vscode
└── extensions.json
├── README.md
├── index.html
├── package-lock.json
├── package.json
├── postcss.config.js
├── public
├── favicon.ico
└── images
│ └── dance.png
├── src
├── App.vue
├── assets
│ ├── base.css
│ ├── logo.svg
│ └── main.css
├── components
│ ├── Home.vue
│ ├── __tests__
│ │ └── HelloWorld.spec.js
│ └── icons
│ │ ├── IconCommunity.vue
│ │ ├── IconDocumentation.vue
│ │ ├── IconEcosystem.vue
│ │ ├── IconSupport.vue
│ │ └── IconTooling.vue
├── index.css
├── main.js
├── router
│ └── index.js
├── stores
│ └── counter.js
└── views
│ └── HomeView.vue
├── tailwind.config.js
├── vite.config.js
└── vitest.config.js
/README.md:
--------------------------------------------------------------------------------
1 | # Event Management
2 |
3 | This is a full-stack web application for Event Management. It provides a backend API built with Laravel and two frontend applications: a landing page and a dashboard. The landing page showcases events, while the dashboard allows for event management and attendee registration.
4 |
5 | ## Requirements
6 |
7 | - PHP >= 7.4
8 | - Composer
9 | - Laravel >= 8.0
10 | - MySQL or another supported database
11 | - Node.js
12 | - npm or Yarn
13 |
14 | ## Installation
15 |
16 | 1. Clone the repository:
17 |
18 | ```shell
19 | git clone https://github.com/FREDVUNI/laravel-vue-events
20 | ```
21 |
22 | 2. Install backend dependencies:
23 |
24 | ```shell
25 | cd event-management
26 | composer install
27 | ```
28 |
29 | 3. Set up the environment:
30 |
31 | ```shell
32 | cp .env.example .env
33 | ```
34 |
35 | Edit the `.env` file and provide the necessary configuration for your database connection.
36 |
37 | 4. Generate the application key:
38 |
39 | ```shell
40 | php artisan key:generate
41 | ```
42 |
43 | 5. Run the database migrations:
44 |
45 | ```shell
46 | php artisan migrate
47 | ```
48 |
49 | 6. Install frontend dependencies for the landing page:
50 |
51 | ```shell
52 | cd landing
53 | npm install
54 | ```
55 |
56 | 7. Install frontend dependencies for the dashboard:
57 |
58 | ```shell
59 | cd admin
60 | npm install
61 | ```
62 |
63 | ## Usage
64 |
65 | ### Start the Development Server
66 |
67 | To start the Laravel development server and serve the backend API and frontend applications together, run the following command:
68 |
69 | ```shell
70 | php artisan serve
71 | ```
72 |
73 | The application will now be accessible at `http://localhost:8000`.
74 |
75 | ### Landing Page
76 |
77 | The landing page is built with Vue.js and Tailwind CSS. It showcases events and provides information to users. To compile the frontend assets and run the landing page, use the following command:
78 |
79 | ```shell
80 | cd landing
81 | npm run dev
82 | ```
83 |
84 | The landing page will be accessible at `http://localhost:5173`.
85 |
86 | ### Screenshot
87 |
88 | 
89 |
90 | ### Dashboard
91 |
92 | The dashboard is also built with Vue.js and Tailwind CSS. It allows for event management and attendee registration using the Laravel API.
93 |
94 | To compile the frontend assets and run the dashboard, use the following command:
95 |
96 | ```shell
97 | cd admin
98 | npm run dev
99 | ```
100 |
101 | The dashboard will be accessible at `http://localhost:5179`
102 |
103 | ### Screenshot
104 |
105 | 
106 |
107 | ## API Endpoints
108 |
109 | The backend API provides various endpoints for managing events, attendees, registrations, and other related functionalities. Refer to the API documentation for detailed information on the available endpoints and request/response formats.
110 |
111 | ## Authentication and Authorization
112 |
113 | You can implement authentication and authorization in the Laravel API using Laravel's built-in features or popular packages like Laravel Passport or Sanctum. Secure your API endpoints and dashboard routes as needed to ensure proper access control.
114 |
115 | ## Testing
116 |
117 | You can run the automated tests for the Laravel API using the following command:
118 |
119 | ```shell
120 | php artisan test
121 | ```
122 |
123 | For the frontend applications, you can run tests using the following commands:
124 |
125 | - Landing Page: `cd landing && npm run test`
126 | - Dashboard: `cd dashboard && npm run test`
127 |
128 | The tests ensure that the API endpoints, frontend components, and their functionalities are working correctly.
129 |
130 | ## Contributing
131 |
132 | Contributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request.
133 |
134 | ## License
135 |
136 | This project is licensed under the [MIT License](LICENSE)
137 |
--------------------------------------------------------------------------------
/admin/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | .DS_Store
12 | dist
13 | dist-ssr
14 | coverage
15 | *.local
16 |
17 | /cypress/videos/
18 | /cypress/screenshots/
19 |
20 | # Editor directories and files
21 | .vscode/*
22 | !.vscode/extensions.json
23 | .idea
24 | *.suo
25 | *.ntvs*
26 | *.njsproj
27 | *.sln
28 | *.sw?
29 |
--------------------------------------------------------------------------------
/admin/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
3 | }
4 |
--------------------------------------------------------------------------------
/admin/README.md:
--------------------------------------------------------------------------------
1 | # events admin
2 |
3 | This template should help get you started developing with Vue 3 in Vite.
4 |
5 | ## Recommended IDE Setup
6 |
7 | [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
8 |
9 | ## Customize configuration
10 |
11 | See [Vite Configuration Reference](https://vitejs.dev/config/).
12 |
13 | ## Project Setup
14 |
15 | ```sh
16 | npm install
17 | ```
18 |
19 | ### Compile and Hot-Reload for Development
20 |
21 | ```sh
22 | npm run dev
23 | ```
24 |
25 | ### Compile and Minify for Production
26 |
27 | ```sh
28 | npm run build
29 | ```
30 |
31 | ### Run Unit Tests with [Vitest](https://vitest.dev/)
32 |
33 | ```sh
34 | npm run test:unit
35 | ```
36 |
--------------------------------------------------------------------------------
/admin/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Events
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/admin/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "events-landing",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "vite",
7 | "build": "vite build",
8 | "preview": "vite preview",
9 | "test:unit": "vitest"
10 | },
11 | "dependencies": {
12 | "@vitejs/plugin-vue": "^5.0.3",
13 | "@vuepic/vue-datepicker": "^7.4.1",
14 | "axios": "^1.6.3",
15 | "flowbite": "^1.6.6",
16 | "pinia": "^2.1.4",
17 | "vue": "^3.3.4",
18 | "vue-router": "^4.2.2",
19 | "vue3-toastify": "^0.2.1",
20 | "vuetify": "^3.5.1"
21 | },
22 | "devDependencies": {
23 | "@vue/test-utils": "^2.3.2",
24 | "autoprefixer": "^10.4.14",
25 | "jsdom": "^22.1.0",
26 | "postcss": "^8.4.24",
27 | "tailwindcss": "^3.3.2",
28 | "vite": "^5.0.12",
29 | "vitest": "^0.32.0"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/admin/postcss.config.js:
--------------------------------------------------------------------------------
1 | /* eslint-env node */
2 | module.exports = {
3 | plugins: [
4 | require("postcss-import"),
5 | require("tailwindcss"),
6 | require("autoprefixer"),
7 | ],
8 | };
9 |
--------------------------------------------------------------------------------
/admin/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FREDVUNI/laravel-vue-events/0b8d2dbdc81ae86f96722c22347ef8483a1e7eee/admin/public/favicon.ico
--------------------------------------------------------------------------------
/admin/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
34 |
--------------------------------------------------------------------------------
/admin/src/assets/base.css:
--------------------------------------------------------------------------------
1 | /* color palette from */
2 | :root {
3 | --vt-c-white: #ffffff;
4 | --vt-c-white-soft: #f8f8f8;
5 | --vt-c-white-mute: #f2f2f2;
6 |
7 | --vt-c-black: #181818;
8 | --vt-c-black-soft: #222222;
9 | --vt-c-black-mute: #282828;
10 |
11 | --vt-c-indigo: #2c3e50;
12 |
13 | --vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
14 | --vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
15 | --vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
16 | --vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);
17 |
18 | --vt-c-text-light-1: var(--vt-c-indigo);
19 | --vt-c-text-light-2: rgba(60, 60, 60, 0.66);
20 | --vt-c-text-dark-1: var(--vt-c-white);
21 | --vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
22 | }
23 |
24 | /* semantic color variables for this project */
25 | :root {
26 | --color-background: var(--vt-c-white);
27 | --color-background-soft: var(--vt-c-white-soft);
28 | --color-background-mute: var(--vt-c-white-mute);
29 |
30 | --color-border: var(--vt-c-divider-light-2);
31 | --color-border-hover: var(--vt-c-divider-light-1);
32 |
33 | --color-heading: var(--vt-c-text-light-1);
34 | --color-text: var(--vt-c-text-light-1);
35 |
36 | --section-gap: 160px;
37 | }
38 |
39 | @media (prefers-color-scheme: dark) {
40 | :root {
41 | --color-background: var(--vt-c-black);
42 | --color-background-soft: var(--vt-c-black-soft);
43 | --color-background-mute: var(--vt-c-black-mute);
44 |
45 | --color-border: var(--vt-c-divider-dark-2);
46 | --color-border-hover: var(--vt-c-divider-dark-1);
47 |
48 | --color-heading: var(--vt-c-text-dark-1);
49 | --color-text: var(--vt-c-text-dark-2);
50 | }
51 | }
52 |
53 | *,
54 | *::before,
55 | *::after {
56 | box-sizing: border-box;
57 | margin: 0;
58 | font-weight: normal;
59 | }
60 |
61 | body {
62 | min-height: 100vh;
63 | color: var(--color-text);
64 | background: var(--color-background);
65 | transition: color 0.5s, background-color 0.5s;
66 | line-height: 1.6;
67 | font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
68 | Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
69 | font-size: 15px;
70 | text-rendering: optimizeLegibility;
71 | -webkit-font-smoothing: antialiased;
72 | -moz-osx-font-smoothing: grayscale;
73 | }
74 |
--------------------------------------------------------------------------------
/admin/src/assets/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/admin/src/assets/main.css:
--------------------------------------------------------------------------------
1 | @import './base.css';
2 | @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');
3 |
4 | body{
5 | font-family: 'Poppins', sans-serif;
6 | }
7 |
--------------------------------------------------------------------------------
/admin/src/components/Dashboard.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Dashboard
5 |
6 |
7 |
Total Events
8 |
{{ events_count }}
9 |
10 |
11 |
Upcoming Events
12 |
{{ upcoming_events_count }}
13 |
14 |
15 |
Registered Users
16 |
{{ users_count }}
17 |
18 |
19 |
Tickets Sold
20 |
{{ sold_tickets_count }}
21 |
22 |
23 |
24 |
25 |
26 |
27 |
93 |
94 |
97 |
--------------------------------------------------------------------------------
/admin/src/components/DashboardCard.vue:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FREDVUNI/laravel-vue-events/0b8d2dbdc81ae86f96722c22347ef8483a1e7eee/admin/src/components/DashboardCard.vue
--------------------------------------------------------------------------------
/admin/src/components/Login.vue:
--------------------------------------------------------------------------------
1 |
2 |
61 |
62 |
63 |
131 |
--------------------------------------------------------------------------------
/admin/src/components/MainContent.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
16 |
--------------------------------------------------------------------------------
/admin/src/components/NotFound.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
404 - Not Found
5 |
6 | Oops! The page you're looking for does not exist.
7 |
8 |
Go back to Home
11 |
12 |
13 |
14 |
15 |
24 |
25 |
28 |
--------------------------------------------------------------------------------
/admin/src/components/Stats.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
{{ title }}
5 |
{{ description }}
6 |
7 |
8 |
9 |
19 |
20 |
23 |
--------------------------------------------------------------------------------
/admin/src/components/__tests__/HelloWorld.spec.js:
--------------------------------------------------------------------------------
1 | import { describe, it, expect } from 'vitest'
2 |
3 | import { mount } from '@vue/test-utils'
4 | import HelloWorld from '../HelloWorld.vue'
5 |
6 | describe('HelloWorld', () => {
7 | it('renders properly', () => {
8 | const wrapper = mount(HelloWorld, { props: { msg: 'Hello Vitest' } })
9 | expect(wrapper.text()).toContain('Hello Vitest')
10 | })
11 | })
12 |
--------------------------------------------------------------------------------
/admin/src/components/api/index.js:
--------------------------------------------------------------------------------
1 | import { computed } from "vue";
2 | import { useAuthStore } from "../../stores/authStore";
3 |
4 | export const url = `${import.meta.env.VITE_API_URL}`;
5 |
6 | export const setHeaders = () => {
7 | const token = computed(() => useAuthStore().token);
8 |
9 | const header = {
10 | headers: {
11 | Authorization: `Bearer ${token.value || localStorage.getItem("token")}`,
12 | },
13 | };
14 |
15 | return header;
16 | };
17 |
--------------------------------------------------------------------------------
/admin/src/components/attendees/Attendee.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Attendees
8 | Add
13 |
14 |
15 |
16 |
17 |
28 |
29 |
30 |
31 |
32 |
37 |
38 |
39 | # |
40 | Name |
41 | Email |
42 | Phone |
43 | |
44 |
45 |
46 |
47 |
48 |
49 | {{ index + 1 }} |
50 | {{ item.name }} |
51 | {{ item.email }} |
52 | {{ item.phone }} |
53 |
54 |
55 | mdi-pencil
56 |
57 | mdi-delete
60 | |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
133 |
134 |
139 |
--------------------------------------------------------------------------------
/admin/src/components/attendees/EditAttendee.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Edit Attendee
5 |
81 |
82 |
83 |
84 |
85 |
194 |
--------------------------------------------------------------------------------
/admin/src/components/events/Event.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Events
8 | Add
13 |
14 |
15 |
16 |
17 |
28 |
29 |
30 |
31 |
32 |
37 |
38 |
39 | # |
40 | Title |
41 | Description |
42 | Start Date |
43 | End Date |
44 | |
45 |
46 |
47 |
48 |
49 |
50 | {{ index + 1 }} |
51 | {{ item.title }} |
52 | {{ shortenDetails(item.description, 10) }} |
53 |
54 | {{ formatDateTime(item.start_date) }}
55 | |
56 |
57 | {{ formatDateTime(item.end_date) }}
58 | |
59 |
60 | editEvent(item.slug)"
62 | class="mx-2 cursor-pointer"
63 | >mdi-pencil
65 | deleteEvent(item.id)"
67 | class="mx-2 cursor-pointer"
68 | >mdi-delete
70 | |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
143 |
144 |
149 |
--------------------------------------------------------------------------------
/admin/src/components/icons/IconCommunity.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/admin/src/components/icons/IconDocumentation.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/admin/src/components/icons/IconEcosystem.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/admin/src/components/icons/IconSupport.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/admin/src/components/icons/IconTooling.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
19 |
20 |
--------------------------------------------------------------------------------
/admin/src/components/layout/SideBar.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
103 |
104 |
105 |
109 |
110 |
111 |
112 |
113 |
114 |
128 |
129 |
139 |
--------------------------------------------------------------------------------
/admin/src/components/layout/TopBar.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |

13 |
Fred
14 |
15 |
34 |
38 |
Dashboard
43 |
Users
48 |
Attendees
53 |
Events
58 |
Settings
63 |
Profile
68 |
Logout
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
87 |
88 |
91 |
--------------------------------------------------------------------------------
/admin/src/components/users/User.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Users
8 | Add
13 |
14 |
15 |
16 |
17 |
28 |
29 |
30 |
31 |
32 |
37 |
38 |
39 | # |
40 | Name |
41 | Email |
42 | Role |
43 | |
44 |
45 |
46 |
47 |
48 |
49 | {{ index + 1 }} |
50 | {{ item.name }} |
51 | {{ item.email }} |
52 | {{ item.role }} |
53 |
54 | mdi-pencil
57 | mdi-delete
60 | |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
128 |
129 |
134 |
--------------------------------------------------------------------------------
/admin/src/index.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
--------------------------------------------------------------------------------
/admin/src/main.js:
--------------------------------------------------------------------------------
1 | import "./assets/main.css";
2 | import "./index.css";
3 |
4 | import { createApp } from "vue";
5 | import { createPinia } from "pinia";
6 | import App from "./App.vue";
7 | import { useAuthStore } from "./stores/authStore";
8 | import router from "./router";
9 | import VueDatePicker from "@vuepic/vue-datepicker";
10 | import "vuetify/styles";
11 | import "@vuepic/vue-datepicker/dist/main.css";
12 | import "vue3-toastify/dist/index.css";
13 |
14 | import { createVuetify } from "vuetify";
15 | import * as components from "vuetify/components";
16 | import * as directives from "vuetify/directives";
17 |
18 | const pinia = createPinia();
19 |
20 | const vuetify = createVuetify({
21 | components,
22 | directives,
23 | });
24 |
25 | const app = createApp(App);
26 |
27 | app.use(vuetify);
28 | app.use(pinia);
29 | app.use(router);
30 | app.component("VueDatePicker", VueDatePicker);
31 |
32 | app.component("useAuthStore", useAuthStore);
33 | app.mount("#app");
34 |
--------------------------------------------------------------------------------
/admin/src/router/index.js:
--------------------------------------------------------------------------------
1 | import { createRouter, createWebHistory } from "vue-router";
2 | import DashboardView from "../views/DashboardView.vue";
3 | import ProfileView from "../views/users/ProfileView.vue";
4 | import LoginView from "../views/LoginView.vue";
5 | import RegisterView from "../views/users/RegisterView.vue";
6 | import EventView from "../views/events/EventView.vue";
7 | import UserView from "../views/users/UserView.vue";
8 | import AddEventView from "../views/events/AddEventView.vue";
9 | import EditEventView from "../views/events/EditEventView.vue";
10 | import AttendeeView from "../views/attendees/AttendeeView.vue";
11 | import AddAttendeeView from "../views/attendees/AddAttendeeView.vue";
12 | import EditAttendeeView from "../views/attendees/EditAttendeeView.vue";
13 | import NotFoundView from "../views/NotFoundView.vue";
14 | import { useAuthStore } from "../stores/authStore";
15 |
16 | const router = createRouter({
17 | history: createWebHistory(import.meta.env.BASE_URL),
18 | routes: [
19 | {
20 | path: "/login",
21 | name: "signin",
22 | component: LoginView,
23 | beforeEnter: (to, from, next) => {
24 | const authStore = useAuthStore();
25 | const isAuthenticated = authStore.isAuthenticated;
26 | if (isAuthenticated) {
27 | next({ name: "home" });
28 | } else {
29 | next();
30 | }
31 | },
32 | },
33 | {
34 | path: "/",
35 | name: "home",
36 | component: DashboardView,
37 | meta: { requiresAuth: true },
38 | },
39 | {
40 | path: "/profile",
41 | name: "profile",
42 | component: ProfileView,
43 | meta: { requiresAuth: true },
44 | },
45 | {
46 | path: "/settings",
47 | name: "settings",
48 | component: RegisterView,
49 | meta: { requiresAuth: true },
50 | },
51 | {
52 | path: "/attendee-management",
53 | name: "attendees",
54 | component: AttendeeView,
55 | meta: { requiresAuth: true },
56 | },
57 | {
58 | path: "/attendee-management/create",
59 | name: "create-attendee",
60 | component: AddAttendeeView,
61 | meta: { requiresAuth: true },
62 | },
63 | {
64 | path: "/attendee-management/edit/:slug",
65 | name: "edit-attendee",
66 | component: EditAttendeeView,
67 | meta: { requiresAuth: true },
68 | },
69 | {
70 | path: "/event-management",
71 | name: "events",
72 | component: EventView,
73 | meta: { requiresAuth: true },
74 | },
75 | {
76 | path: "/event-management/create",
77 | name: "create-event",
78 | component: AddEventView,
79 | meta: { requiresAuth: true },
80 | },
81 | {
82 | path: "/event-management/edit/:slug",
83 | name: "edit-event",
84 | component: EditEventView,
85 | meta: { requiresAuth: true },
86 | },
87 | {
88 | path: "/users",
89 | name: "users",
90 | component: UserView,
91 | meta: { requiresAuth: true },
92 | },
93 | {
94 | path: "/:catchAll(.*)",
95 | name: "not-found",
96 | component: NotFoundView,
97 | },
98 | ],
99 | });
100 |
101 | router.beforeEach((to, from, next) => {
102 | const authStore = useAuthStore();
103 | const isAuthenticated = authStore.isAuthenticated || localStorage.getItem("token");
104 | if (to.name === "signin" && isAuthenticated) {
105 | next({ name: "home" });
106 | } else if (
107 | to.name !== "signin" &&
108 | to.matched.some((record) => record.meta.requiresAuth) &&
109 | !isAuthenticated
110 | ) {
111 | next({ name: "signin" });
112 | } else {
113 | next();
114 | }
115 | });
116 |
117 | export default router;
118 |
--------------------------------------------------------------------------------
/admin/src/stores/authStore.js:
--------------------------------------------------------------------------------
1 | import { defineStore } from "pinia";
2 |
3 | export const useAuthStore = defineStore("auth", {
4 | state: () => ({
5 | isAuthenticated: false,
6 | token: localStorage.getItem("token") || null,
7 | }),
8 | actions: {
9 | setAuthenticated(value) {
10 | this.isAuthenticated = value;
11 | },
12 | setToken(token) {
13 | this.token = token;
14 | localStorage.setItem("token", token);
15 | },
16 | clearToken() {
17 | this.token = null;
18 | localStorage.removeItem("token");
19 | },
20 | },
21 | });
22 |
--------------------------------------------------------------------------------
/admin/src/stores/counter.js:
--------------------------------------------------------------------------------
1 | import { ref, computed } from 'vue'
2 | import { defineStore } from 'pinia'
3 |
4 | export const useCounterStore = defineStore('counter', () => {
5 | const count = ref(0)
6 | const doubleCount = computed(() => count.value * 2)
7 | function increment() {
8 | count.value++
9 | }
10 |
11 | return { count, doubleCount, increment }
12 | })
13 |
--------------------------------------------------------------------------------
/admin/src/utils/index.js:
--------------------------------------------------------------------------------
1 | export const shortenDetails = (details, maxLength) => {
2 | if (details.length > maxLength) {
3 | return details.substring(0, maxLength) + "...";
4 | }
5 | return details;
6 | };
7 |
8 | export const formatDateTime = (dateTime) => {
9 | const options = {
10 | year: "numeric",
11 | month: "long",
12 | day: "numeric",
13 | hour: "2-digit",
14 | minute: "2-digit",
15 | };
16 | return new Date(dateTime).toLocaleString(undefined, options);
17 | };
18 |
19 | export const formatDate = (date) => {
20 | const year = date.getFullYear();
21 | const month = String(date.getMonth() + 1).padStart(2, "0");
22 | const day = String(date.getDate()).padStart(2, "0");
23 | const hours = String(date.getHours()).padStart(2, "0");
24 | const minutes = String(date.getMinutes()).padStart(2, "0");
25 | const seconds = String(date.getSeconds()).padStart(2, "0");
26 |
27 | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
28 | };
29 |
30 | export const slugify = (text) => {
31 | return text
32 | .toLowerCase()
33 | .replace(/[^\w\s-]/g, "")
34 | .replace(/\s+/g, "-")
35 | .replace(/--+/g, "-")
36 | .trim();
37 | };
38 |
--------------------------------------------------------------------------------
/admin/src/views/DashboardView.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/admin/src/views/LoginView.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/admin/src/views/NotFoundView.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/admin/src/views/attendees/AddAttendeeView.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/admin/src/views/attendees/AttendeeView.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/admin/src/views/attendees/EditAttendeeView.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/admin/src/views/events/AddEventView.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/admin/src/views/events/EditEventView.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/admin/src/views/events/EventView.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/admin/src/views/users/ProfileView.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/admin/src/views/users/RegisterView.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/admin/src/views/users/UserView.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/admin/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /* eslint-env node */
2 |
3 | const plugin = require("tailwindcss/plugin");
4 |
5 | module.exports = {
6 | content: ["./index.html", "./src/**/*.{vue,js,ts,jsx,tsx}"],
7 | };
8 |
--------------------------------------------------------------------------------
/admin/vite.config.mjs:
--------------------------------------------------------------------------------
1 | import { fileURLToPath, URL } from "node:url";
2 |
3 | import { defineConfig } from "vite";
4 | import vue from "@vitejs/plugin-vue";
5 |
6 | // https://vitejs.dev/config/
7 | export default defineConfig({
8 | plugins: [vue()],
9 | resolve: {
10 | alias: {
11 | "@": fileURLToPath(new URL("./src", import.meta.url)),
12 | },
13 | },
14 | define: {
15 | "import.meta.env": {
16 | VITE_API_URL: process.env.VITE_API_URL,
17 | },
18 | },
19 | });
20 |
--------------------------------------------------------------------------------
/admin/vitest.config.js:
--------------------------------------------------------------------------------
1 | import { fileURLToPath } from 'node:url'
2 | import { mergeConfig } from 'vite'
3 | import { configDefaults, defineConfig } from 'vitest/config'
4 | import viteConfig from './vite.config'
5 |
6 | export default mergeConfig(
7 | viteConfig,
8 | defineConfig({
9 | test: {
10 | environment: 'jsdom',
11 | exclude: [...configDefaults.exclude, 'e2e/*'],
12 | root: fileURLToPath(new URL('./', import.meta.url)),
13 | transformMode: {
14 | web: [/\.[jt]sx$/]
15 | }
16 | }
17 | })
18 | )
19 |
--------------------------------------------------------------------------------
/api/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | end_of_line = lf
6 | insert_final_newline = true
7 | indent_style = space
8 | indent_size = 4
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
13 |
14 | [*.{yml,yaml}]
15 | indent_size = 2
16 |
17 | [docker-compose.yml]
18 | indent_size = 4
19 |
--------------------------------------------------------------------------------
/api/.env.example:
--------------------------------------------------------------------------------
1 | APP_NAME=Laravel
2 | APP_ENV=local
3 | APP_KEY=
4 | APP_DEBUG=true
5 | APP_URL=http://localhost
6 |
7 | LOG_CHANNEL=stack
8 | LOG_DEPRECATIONS_CHANNEL=null
9 | LOG_LEVEL=debug
10 |
11 | DB_CONNECTION=mysql
12 | DB_HOST=127.0.0.1
13 | DB_PORT=3306
14 | DB_DATABASE=laravel
15 | DB_USERNAME=root
16 | DB_PASSWORD=
17 |
18 | BROADCAST_DRIVER=log
19 | CACHE_DRIVER=file
20 | FILESYSTEM_DRIVER=local
21 | QUEUE_CONNECTION=sync
22 | SESSION_DRIVER=file
23 | SESSION_LIFETIME=120
24 |
25 | MEMCACHED_HOST=127.0.0.1
26 |
27 | REDIS_HOST=127.0.0.1
28 | REDIS_PASSWORD=null
29 | REDIS_PORT=6379
30 |
31 | MAIL_MAILER=smtp
32 | MAIL_HOST=mailhog
33 | MAIL_PORT=1025
34 | MAIL_USERNAME=null
35 | MAIL_PASSWORD=null
36 | MAIL_ENCRYPTION=null
37 | MAIL_FROM_ADDRESS=null
38 | MAIL_FROM_NAME="${APP_NAME}"
39 |
40 | AWS_ACCESS_KEY_ID=
41 | AWS_SECRET_ACCESS_KEY=
42 | AWS_DEFAULT_REGION=us-east-1
43 | AWS_BUCKET=
44 | AWS_USE_PATH_STYLE_ENDPOINT=false
45 |
46 | PUSHER_APP_ID=
47 | PUSHER_APP_KEY=
48 | PUSHER_APP_SECRET=
49 | PUSHER_APP_CLUSTER=mt1
50 |
51 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
52 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
53 |
--------------------------------------------------------------------------------
/api/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 |
3 | *.blade.php diff=html
4 | *.css diff=css
5 | *.html diff=html
6 | *.md diff=markdown
7 | *.php diff=php
8 |
9 | /.github export-ignore
10 | CHANGELOG.md export-ignore
11 |
--------------------------------------------------------------------------------
/api/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /public/hot
3 | /public/storage
4 | /storage/*.key
5 | /vendor
6 | .env
7 | .env.backup
8 | .phpunit.result.cache
9 | docker-compose.override.yml
10 | Homestead.json
11 | Homestead.yaml
12 | npm-debug.log
13 | yarn-error.log
14 | /.idea
15 | /.vscode
16 |
--------------------------------------------------------------------------------
/api/.styleci.yml:
--------------------------------------------------------------------------------
1 | php:
2 | preset: laravel
3 | version: 8
4 | disabled:
5 | - no_unused_imports
6 | finder:
7 | not-name:
8 | - index.php
9 | - server.php
10 | js:
11 | finder:
12 | not-name:
13 | - webpack.mix.js
14 | css: true
15 |
--------------------------------------------------------------------------------
/api/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | ## About Laravel
11 |
12 | Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
13 |
14 | - [Simple, fast routing engine](https://laravel.com/docs/routing).
15 | - [Powerful dependency injection container](https://laravel.com/docs/container).
16 | - Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
17 | - Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
18 | - Database agnostic [schema migrations](https://laravel.com/docs/migrations).
19 | - [Robust background job processing](https://laravel.com/docs/queues).
20 | - [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
21 |
22 | Laravel is accessible, powerful, and provides tools required for large, robust applications.
23 |
24 | ## Learning Laravel
25 |
26 | Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
27 |
28 | If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
29 |
30 | ## Laravel Sponsors
31 |
32 | We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).
33 |
34 | ### Premium Partners
35 |
36 | - **[Vehikl](https://vehikl.com/)**
37 | - **[Tighten Co.](https://tighten.co)**
38 | - **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
39 | - **[64 Robots](https://64robots.com)**
40 | - **[Cubet Techno Labs](https://cubettech.com)**
41 | - **[Cyber-Duck](https://cyber-duck.co.uk)**
42 | - **[Many](https://www.many.co.uk)**
43 | - **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
44 | - **[DevSquad](https://devsquad.com)**
45 | - **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
46 | - **[OP.GG](https://op.gg)**
47 | - **[WebReinvent](https://webreinvent.com/?utm_source=laravel&utm_medium=github&utm_campaign=patreon-sponsors)**
48 | - **[Lendio](https://lendio.com)**
49 |
50 | ## Contributing
51 |
52 | Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
53 |
54 | ## Code of Conduct
55 |
56 | In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
57 |
58 | ## Security Vulnerabilities
59 |
60 | If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
61 |
62 | ## License
63 |
64 | The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
65 |
--------------------------------------------------------------------------------
/api/app/Console/Kernel.php:
--------------------------------------------------------------------------------
1 | command('inspire')->hourly();
19 | }
20 |
21 | /**
22 | * Register the commands for the application.
23 | *
24 | * @return void
25 | */
26 | protected function commands()
27 | {
28 | $this->load(__DIR__.'/Commands');
29 |
30 | require base_path('routes/console.php');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/api/app/Exceptions/Handler.php:
--------------------------------------------------------------------------------
1 | >
14 | */
15 | protected $dontReport = [
16 | //
17 | ];
18 |
19 | /**
20 | * A list of the inputs that are never flashed for validation exceptions.
21 | *
22 | * @var array
23 | */
24 | protected $dontFlash = [
25 | 'current_password',
26 | 'password',
27 | 'password_confirmation',
28 | ];
29 |
30 | /**
31 | * Register the exception handling callbacks for the application.
32 | *
33 | * @return void
34 | */
35 | public function register()
36 | {
37 | $this->reportable(function (Throwable $e) {
38 | //
39 | });
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/api/app/Helpers/UploadImage.php:
--------------------------------------------------------------------------------
1 | getClientOriginalExtension();
10 |
11 | // Move the uploaded image to the specified folder
12 | $file->move(public_path('uploads/' . $folder), $imageName);
13 |
14 | return $imageName;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/api/app/Http/Controllers/AttendeeController.php:
--------------------------------------------------------------------------------
1 | json(['attendees' => $attendees], 200);
16 | } catch (\Exception $e) {
17 | return response()->json(['message' => 'Something went wrong.'], 500);
18 | }
19 | }
20 | public function store(Request $request)
21 | {
22 | try {
23 | $data = $request->validate([
24 | 'name' => 'required|min:3|string',
25 | 'phone' => 'required|min:10|max:14|unique:attendees',
26 | 'email' => 'required|email|unique:attendees',
27 | 'slug' => 'required',
28 | 'event_id' => 'required|exists:events,id',
29 | ]);
30 | $attendee = Attendee::createAttendee($data);
31 | $event = Event::findOrFail($data['event_id']);
32 | $event->attendees()->attach($attendee->id);
33 | return response()->json(['attendees' => $attendee], 201);
34 | } catch (\Illuminate\Validation\ValidationException $e) {
35 | return response()->json(['errors' => $e->errors()], 400);
36 | } catch (\Exception $e) {
37 | return response()->json(['message' => 'Something went wrong.' . $e], 500);
38 | }
39 | }
40 | public function show($slug)
41 | {
42 | try {
43 | $attendee = Attendee::getAttendee($slug);
44 | return response()->json(['attendee' => $attendee], 200);
45 | } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
46 | return response()->json(['message' => 'Attendee not found.'], 404);
47 | } catch (\Exception $e) {
48 | return response()->json(['message' => 'Something went wrong.'], 500);
49 | }
50 | }
51 | public function edit($slug)
52 | {
53 | try {
54 | $attendee = Attendee::editAttendee($slug);
55 | return response()->json(['attendee' => $attendee], 200);
56 | } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
57 | return response()->json(['message' => 'Attendee not found.'], 404);
58 | } catch (\Exception $e) {
59 | return response()->json(['message' => 'Something went wrong.'], 500);
60 | }
61 | }
62 | public function update(Request $request, $slug)
63 | {
64 | try {
65 | $data = $request->validate([
66 | 'name' => 'required|min:5',
67 | 'phone' => 'required|min:10|max:14',
68 | 'email' => 'required|email',
69 | 'slug' => 'required',
70 | 'event_id' => 'required|exists:events,id',
71 | ]);
72 | $attendee = Attendee::getAttendee($slug);
73 |
74 | $currentEvent = $attendee->events()->first();
75 | if ($currentEvent) {
76 | $currentEvent->attendees()->detach($attendee->id);
77 | }
78 |
79 | $update = Attendee::updateAttendee($data, $slug);
80 |
81 | $newEvent = Event::findOrFail($data['event_id']);
82 | $newEvent->attendees()->attach($attendee->id);
83 |
84 | return response()->json(['attendee' => $update], 200);
85 | } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
86 | return response()->json(['message' => 'Attendee not found.'], 404);
87 | } catch (\Exception $e) {
88 | return response()->json(['message' => 'Something went wrong.'], 500);
89 | }
90 | }
91 | public function delete($slug)
92 | {
93 | try {
94 | Attendee::deleteAttendee($slug);
95 | return response()->json(["message" => "Attendee has been deleted."]);
96 | } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
97 | return response()->json(['message' => 'Attendee not found.'], 404);
98 | } catch (\Exception $e) {
99 | return response()->json(['message' => 'Something went wrong.'], 500);
100 | }
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/api/app/Http/Controllers/Auth/AuthController.php:
--------------------------------------------------------------------------------
1 | validate([
18 | 'name' => 'required|min:4',
19 | 'email' => 'required|email|unique:users',
20 | 'password' => 'required|min:6',
21 | 'role' => 'required'
22 | ]);
23 |
24 | $user = User::createUser($data);
25 | $token = $user->createToken('auth-token')->plainTextToken;
26 | return response()->json(['token' => $token], 201);
27 | } catch (ValidationException $e) {
28 | return response()->json(['errors' => $e->errors()], 422);
29 | }
30 | }
31 | public function signin(Request $request)
32 | {
33 | try {
34 | $data = $request->validate([
35 | 'email' => 'required|email',
36 | 'password' => 'required',
37 | ]);
38 | $user = User::userLogin($data);
39 | $token = $user->createToken('auth-token')->plainTextToken;
40 | return response()->json(['token' => $token], 200);
41 | } catch (ValidationException $e) {
42 | return response()->json(['errors' => $e->errors()], 401);
43 | }
44 | }
45 | public function logout(Request $request)
46 | {
47 | // $tokenId = Str::before($request->bearerToken(), '|');
48 | // $token = $request->bearerToken();
49 |
50 |
51 | // dd($token);
52 | try {
53 | $user = $request->user();
54 | if ($user) {
55 | $user->tokens()->delete();
56 | return response()->json(['message' => 'You have logged out.'], 200);
57 | } else {
58 | return response()->json(['message' => 'User not authenticated'], 401);
59 | }
60 | } catch (\Exception $e) {
61 | return response()->json(['message' => 'Error occurred during logout'], 500);
62 | }
63 | }
64 | public function user(Request $request)
65 | {
66 | try {
67 | return response()->json([
68 | 'id' => Auth::id(),
69 | 'name' => Auth::user()->name,
70 | 'email' => Auth::user()->email,
71 | 'role' => Auth::user()->role,
72 | ]);
73 | } catch (\Exception $e) {
74 | return response()->json(['message' => 'Error occurred.'], 500);
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/api/app/Http/Controllers/AuthController.php:
--------------------------------------------------------------------------------
1 | validate([
15 | 'name' => 'required',
16 | 'email' => 'required|email|unique:users',
17 | 'password' => 'required|min:6',
18 | 'role' => 'required'
19 | ]);
20 |
21 | $user = User::create([
22 | 'name' => $data['name'],
23 | 'email' => $data['email'],
24 | 'password' => Hash::make($data['password']),
25 | 'role' => 'admin',
26 | ]);
27 | $token = $user->createToken('auth-token')->plainTextToken;
28 | return response()->json(['token' => $token], 201);
29 |
30 | }
31 | public function signin(){
32 | $data = request()->validate([
33 | 'email' => 'required|email',
34 | 'password' => 'required',
35 | ]);
36 |
37 | if (Auth::attempt($data)) {
38 | $user = request()->user();
39 | $token = $user->createToken('auth-token')->plainTextToken;
40 |
41 | return response()->json(['token' => $token], 200);
42 | }
43 |
44 | return response()->json(['message' => 'Invalid credentials'], 401);
45 | }
46 | public function logout(){
47 | request()->user()->currentAccessToken()->delete();
48 | return response()->json(['message' => 'Logged out successfully'], 200);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/api/app/Http/Controllers/Controller.php:
--------------------------------------------------------------------------------
1 | json(['events' => $events], 200);
16 | } catch (\Exception $e) {
17 | return response()->json(['message' => 'Something went wrong.'], 500);
18 | }
19 | }
20 | public function store(Request $request)
21 | {
22 | try {
23 | $data = $request->validate([
24 | "title" => "required|unique:events|min:4|max:20",
25 | "description" => "required|min:4|max:200",
26 | "slug" => "required",
27 | "image" => "required|image|max:2048|mimes:jpeg,jpg,png,gif",
28 | "start_date" => "required|date_format:Y-m-d H:i:s|after:now",
29 | "end_date" => "required|date_format:Y-m-d H:i:s|after:now",
30 | ]);
31 |
32 | if ($request->hasFile('image')) {
33 | $image = $request->file('image');
34 | $imageName = UploadImage($image, 'events');
35 | $data['image'] = $imageName;
36 | }
37 | $event = Event::createEvent($data);
38 | return response()->json(['events' => $event], 201);
39 | } catch (\Illuminate\Validation\ValidationException $e) {
40 | return response()->json(['errors' => $e->errors()], 400);
41 | } catch (\Exception $e) {
42 | return response()->json(['message' => 'Something went wrong.' . $e], 500);
43 | }
44 | }
45 | public function show($slug)
46 | {
47 | try {
48 | $event = Event::getEvent($slug);
49 | return response()->json(['event' => $event], 200);
50 | } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
51 | return response()->json(['message' => 'Event not found.'], 404);
52 | } catch (\Exception $e) {
53 | return response()->json(['message' => 'Something went wrong.'], 500);
54 | }
55 | }
56 |
57 | public function edit($slug)
58 | {
59 | try {
60 | $event = Event::editEvent($slug);
61 | return response()->json(['event' => $event], 200);
62 | } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
63 | return response()->json(['message' => 'Event not found.'], 404);
64 | } catch (\Exception $e) {
65 | return response()->json(['message' => 'Something went wrong.'], 500);
66 | }
67 | }
68 |
69 | public function update(Request $request, $slug)
70 | {
71 | try {
72 | // dd($request->all());
73 | $data = $request->validate([
74 | "title" => "required|min:4|max:20",
75 | "description" => "required|min:4|max:200",
76 | "slug" => "required",
77 | "image" => "required|image|max:2048|mimes:jpg,gif,png",
78 | "start_date" => "required|date_format:Y-m-d H:i:s|after:now",
79 | "end_date" => "required|date_format:Y-m-d H:i:s|after:now",
80 | ]);
81 | $event = Event::getEvent($slug);
82 |
83 | if ($request->hasFile('image')) {
84 | $image = $request->file('image');
85 |
86 | if ($event->image && file_exists(public_path('uploads/events/' . $event->image))) {
87 | unlink(public_path('uploads/events/' . $event->image));
88 | }
89 |
90 | $imageName = UploadImage($image, 'events');
91 | $data['image'] = $imageName;
92 | } else {
93 | $data['image'] = $event->image;
94 | }
95 |
96 | $events = Event::updateEvent($slug, $data);
97 | return response()->json(['event' => $events], 200);
98 | } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
99 | return response()->json(['message' => 'Event not found.'], 404);
100 | } catch (\Illuminate\Validation\ValidationException $e) {
101 | return response()->json(['errors' => $e->errors()], 400);
102 | } catch (\Exception $e) {
103 | return response()->json(['message' => 'Something went wrong.'], 500);
104 | }
105 | }
106 | public function delete($slug)
107 | {
108 | try {
109 | $event = Event::getEvent($slug);
110 |
111 | if ($event->image && file_exists(public_path('uploads/events/' . $event->image))) {
112 | unlink(public_path('uploads/events/' . $event->image));
113 | }
114 |
115 | Event::deleteEvent($slug);
116 | return response()->json(['message' => 'The event has been deleted.'], 200);
117 | } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
118 | return response()->json(['message' => 'Event not found.'], 404);
119 | } catch (\Exception $e) {
120 | return response()->json(['message' => 'Something went wrong.'], 500);
121 | }
122 | }
123 | public function count()
124 | {
125 | try {
126 | $events = Event::FetchEvents();
127 | $eventCount = count($events);
128 | return response()->json(['count' => $eventCount], 200);
129 | } catch (\Exception $e) {
130 | return response()->json(['message' => 'Something went wrong.'], 500);
131 | }
132 | }
133 | public function countUpcomingEvents()
134 | {
135 | try {
136 | $currentDate = now();
137 | $events = Event::where('start_date', '>=', $currentDate)
138 | ->get();
139 |
140 | $eventCount = $events->count();
141 | return response()->json(['count' => $eventCount], 200);
142 | } catch (\Exception $e) {
143 | return response()->json(['message' => 'Something went wrong.'], 500);
144 | }
145 | }
146 | }
147 |
--------------------------------------------------------------------------------
/api/app/Http/Controllers/PaymentController.php:
--------------------------------------------------------------------------------
1 | validate([
14 | 'payment_method' => 'required|string',
15 | 'payment_status' => 'required|string',
16 | 'ticket_id' => 'required',
17 | ]);
18 |
19 | $payment = (new Payment())->createPayment($data);
20 |
21 | return response()->json($payment, 201);
22 | } catch (\Illuminate\Validation\ValidationException $e) {
23 | return response()->json(['errors' => $e->errors()], 400);
24 | } catch (\Exception $e) {
25 | return response()->json(['message' => 'Something went wrong.'], 500);
26 | }
27 | }
28 |
29 | public function index()
30 | {
31 | try {
32 | $payments = Payment::all();
33 |
34 | return response()->json($payments);
35 | } catch (\Exception $e) {
36 | return response()->json(['message' => 'Something went wrong.'], 500);
37 | }
38 | }
39 |
40 | public function show($slug)
41 | {
42 | try {
43 | $payment = Payment::whereHas('ticket', function ($query) use ($slug) {
44 | $query->where('slug', $slug);
45 | })->firstOrFail();
46 |
47 | return response()->json($payment);
48 | } catch (\Exception $e) {
49 | return response()->json(['message' => 'Something went wrong.'], 500);
50 | }
51 | }
52 |
53 | public function update(Request $request, $slug)
54 | {
55 | try {
56 | $payment = Payment::whereHas('ticket', function ($query) use ($slug) {
57 | $query->where('slug', $slug);
58 | })->firstOrFail();
59 |
60 | $payment->update($request->all());
61 |
62 | return response()->json($payment);
63 | } catch (\Exception $e) {
64 | return response()->json(['message' => 'Something went wrong.'], 500);
65 | }
66 | }
67 |
68 | public function cancel($slug)
69 | {
70 | try {
71 | $payment = Payment::whereHas('ticket', function ($query) use ($slug) {
72 | $query->where('slug', $slug);
73 | })->firstOrFail();
74 |
75 | $payment->update(['payment_status' => 'canceled']);
76 |
77 | return response()->json($payment);
78 | } catch (\Exception $e) {
79 | return response()->json(['message' => 'Something went wrong.'], 500);
80 | }
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/api/app/Http/Controllers/TicketController.php:
--------------------------------------------------------------------------------
1 | validate([
14 | 'ticket_type' => 'required|string',
15 | 'price' => 'required|numeric',
16 | 'slug' => 'required',
17 | 'event_id' => 'required|exists:events,id',
18 | 'user_id' => 'required|exists:users,id',
19 | ]);
20 |
21 | $ticket = Ticket::createTicket($data);
22 | return response()->json(['tickets' => $ticket], 201);
23 | } catch (\Illuminate\Validation\ValidationException $e) {
24 | return response()->json(['errors' => $e->errors()], 400);
25 | } catch (\Exception $e) {
26 | dd($e);
27 | return response()->json(['message' => 'Something went wrong.'], 500);
28 | }
29 | }
30 |
31 | public function tickets()
32 | {
33 | try {
34 | $tickets = Ticket::FetchTickets();
35 | return response()->json(['tickets' => $tickets], 200);
36 | } catch (\Exception $e) {
37 | return response()->json(['message' => $e], 500);
38 | }
39 | }
40 |
41 | public function count()
42 | {
43 | try {
44 | $tickets = Ticket::FetchTickets();
45 | $ticketCount = count($tickets);
46 | return response()->json(['count' => $ticketCount], 200);
47 | } catch (\Exception $e) {
48 | return response()->json(['message' => 'Something went wrong.'], 500);
49 | }
50 | }
51 |
52 | public function update(Request $request, $slug)
53 | {
54 | try {
55 | $request->validate([
56 | 'ticket_type' => 'required|string',
57 | 'price' => 'required|numeric',
58 | 'start_date' => 'required|date',
59 | 'end_date' => 'required|date|after:start_date',
60 | ]);
61 |
62 | $ticket = Ticket::updateTicket($slug, $request->all());
63 |
64 | return response()->json($ticket, 200);
65 | } catch (\Exception $e) {
66 | return response()->json(['message' => 'Something went wrong.'], 500);
67 | }
68 | }
69 |
70 | public function delete($slug)
71 | {
72 | try {
73 | Ticket::deleteTicket($slug);
74 |
75 | return response()->json(['message' => 'Ticket deleted successfully'], 200);
76 | } catch (\Exception $e) {
77 | return response()->json(['message' => 'Something went wrong.'], 500);
78 | }
79 | }
80 |
81 | public function cancel($slug)
82 | {
83 | try {
84 | $ticket = Ticket::getTicket($slug);
85 | $ticket->cancel();
86 |
87 | return response()->json($ticket, 200);
88 | } catch (\Exception $e) {
89 | return response()->json(['message' => 'Something went wrong.'], 500);
90 | }
91 | }
92 |
93 | public function markAsPaid($slug)
94 | {
95 | try {
96 | $ticket = Ticket::getTicket($slug);
97 | $ticket->markAsPaid();
98 |
99 | return response()->json($ticket, 200);
100 | } catch (\Exception $e) {
101 | return response()->json(['message' => 'Something went wrong.'], 500);
102 | }
103 | }
104 |
105 | public function markAsUnpaid($slug)
106 | {
107 | try {
108 | $ticket = Ticket::getTicket($slug);
109 | $ticket->markAsUnpaid();
110 |
111 | return response()->json($ticket, 200);
112 | } catch (\Exception $e) {
113 | return response()->json(['message' => 'Something went wrong.'], 500);
114 | }
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/api/app/Http/Controllers/UserController.php:
--------------------------------------------------------------------------------
1 | json(['users' => $users], 200);
16 | } catch (\Exception $e) {
17 | return response()->json(['message' => 'Something went wrong.'], 500);
18 | }
19 | }
20 | public function show($id)
21 | {
22 | try {
23 | $user = User::getUser($id);
24 | return response()->json(['user' => $user], 200);
25 | } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
26 | return response()->json(['message' => 'User not found.'], 404);
27 | } catch (\Exception $e) {
28 | return response()->json(['message' => 'Something went wrong.'], 500);
29 | }
30 | }
31 | public function edit($slug)
32 | {
33 | try {
34 | $user = User::editUser($slug);
35 | return response()->json(['user' => $user], 200);
36 | } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
37 | return response()->json(['message' => 'Event not found.'], 404);
38 | } catch (\Exception $e) {
39 | return response()->json(['message' => 'Something went wrong.'], 500);
40 | }
41 | }
42 | public function update(Request $request, $id)
43 | {
44 | try {
45 | $data = $request->validate([
46 | 'name' => 'required|min:4',
47 | 'email' => 'required|email|unique:users,email,' . $id,
48 | 'password' => 'required|min:6',
49 | 'role' => 'required'
50 | ]);
51 | $user = User::getUser($id);
52 | $update = User::updateUser($id, $data);
53 | return response()->json(['user' => $update], 200);
54 | } catch (ValidationException $e) {
55 | return response()->json(['errors' => $e->errors()], 400);
56 | } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
57 | return response()->json(['message' => 'user not found.'], 404);
58 | } catch (\Exception $e) {
59 | return response()->json(['message' => 'Something went wrong.'], 500);
60 | }
61 | }
62 | public function delete($id)
63 | {
64 | try {
65 | User::deleteUser($id);
66 | return response()->json(["message" => "user has been deleted."]);
67 | } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
68 | return response()->json(['message' => 'user not found.'], 404);
69 | } catch (\Exception $e) {
70 | return response()->json(['message' => 'Something went wrong.'], 500);
71 | }
72 | }
73 | public function count()
74 | {
75 | try {
76 | $users = User::fetchUsers();
77 | $userCount = count($users);
78 | return response()->json(['count' => $userCount], 200);
79 | } catch (\Exception $e) {
80 | return response()->json(['message' => 'Something went wrong.'], 500);
81 | }
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/api/app/Http/Kernel.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | protected $middleware = [
17 | // \App\Http\Middleware\TrustHosts::class,
18 | \App\Http\Middleware\TrustProxies::class,
19 | \Fruitcake\Cors\HandleCors::class,
20 | \App\Http\Middleware\PreventRequestsDuringMaintenance::class,
21 | \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
22 | \App\Http\Middleware\TrimStrings::class,
23 | \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
24 | ];
25 |
26 | /**
27 | * The application's route middleware groups.
28 | *
29 | * @var array>
30 | */
31 | protected $middlewareGroups = [
32 | 'web' => [
33 | \App\Http\Middleware\EncryptCookies::class,
34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
35 | \Illuminate\Session\Middleware\StartSession::class,
36 | // \Illuminate\Session\Middleware\AuthenticateSession::class,
37 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
38 | \App\Http\Middleware\VerifyCsrfToken::class,
39 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
40 | ],
41 |
42 | 'api' => [
43 | // \App\Http\Middleware\SanctumAuthenticate::class,
44 | \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
45 | 'throttle:api',
46 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
47 | ],
48 | ];
49 |
50 | /**
51 | * The application's route middleware.
52 | *
53 | * These middleware may be assigned to groups or used individually.
54 | *
55 | * @var array
56 | */
57 | protected $routeMiddleware = [
58 | 'auth' => \App\Http\Middleware\Authenticate::class,
59 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
60 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
61 | 'can' => \Illuminate\Auth\Middleware\Authorize::class,
62 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
63 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
64 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
65 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
66 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
67 | ];
68 | }
69 |
--------------------------------------------------------------------------------
/api/app/Http/Middleware/Authenticate.php:
--------------------------------------------------------------------------------
1 | expectsJson()) {
18 | return route('login');
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/api/app/Http/Middleware/EncryptCookies.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | //
16 | ];
17 | }
18 |
--------------------------------------------------------------------------------
/api/app/Http/Middleware/PreventRequestsDuringMaintenance.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | //
16 | ];
17 | }
18 |
--------------------------------------------------------------------------------
/api/app/Http/Middleware/RedirectIfAuthenticated.php:
--------------------------------------------------------------------------------
1 | check()) {
26 | return redirect(RouteServiceProvider::HOME);
27 | }
28 | }
29 |
30 | return $next($request);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/api/app/Http/Middleware/SanctumAuthenticate.php:
--------------------------------------------------------------------------------
1 | check()) {
15 | return $next($request);
16 | }
17 | }
18 |
19 | return response()->json(['message' => 'Unauthenticated.'], 401);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/api/app/Http/Middleware/TrimStrings.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | 'current_password',
16 | 'password',
17 | 'password_confirmation',
18 | ];
19 | }
20 |
--------------------------------------------------------------------------------
/api/app/Http/Middleware/TrustHosts.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | public function hosts()
15 | {
16 | return [
17 | $this->allSubdomainsOfApplicationUrl(),
18 | ];
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/api/app/Http/Middleware/TrustProxies.php:
--------------------------------------------------------------------------------
1 | |string|null
14 | */
15 | protected $proxies;
16 |
17 | /**
18 | * The headers that should be used to detect proxies.
19 | *
20 | * @var int
21 | */
22 | protected $headers =
23 | Request::HEADER_X_FORWARDED_FOR |
24 | Request::HEADER_X_FORWARDED_HOST |
25 | Request::HEADER_X_FORWARDED_PORT |
26 | Request::HEADER_X_FORWARDED_PROTO |
27 | Request::HEADER_X_FORWARDED_AWS_ELB;
28 | }
29 |
--------------------------------------------------------------------------------
/api/app/Http/Middleware/VerifyCsrfToken.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | //
16 | ];
17 | }
18 |
--------------------------------------------------------------------------------
/api/app/Models/Attendee.php:
--------------------------------------------------------------------------------
1 | $data['name'],
24 | 'email' => $data['email'],
25 | 'phone' => $data['phone'],
26 | 'slug' => Str::slug($data['name'] . " " . $data['email']),
27 | 'event_id' => $data['event_id'],
28 | ]);
29 | }
30 |
31 | public static function getAttendee($slug)
32 | {
33 | $attendee = self::where('slug', $slug)->firstorFail();
34 | return $attendee;
35 | }
36 |
37 | public static function showAttendee($slug)
38 | {
39 | $attendee = self::where('slug', $slug)->firstorFail();
40 | return $attendee;
41 | }
42 |
43 | public static function editAttendee($slug)
44 | {
45 | $attendee = self::where('slug', $slug)->firstorFail();
46 | return $attendee;
47 | }
48 |
49 | public static function updateAttendee(array $data, $slug)
50 | {
51 | $attendee = self::where('slug', $slug)->firstorFail();
52 | $attendee->update([
53 | 'name' => $data['name'],
54 | 'email' => $data['email'],
55 | 'phone' => $data['phone'],
56 | 'email_id' => $data['email_id'],
57 | 'slug' => Str::slug($data['name'] . " " . $data['email']),
58 | 'event_id' => $data['event_id'],
59 | ]);
60 | return $attendee;
61 | }
62 |
63 | public static function deleteAttendee($slug)
64 | {
65 | $attendee = self::where('slug', $slug)->firstorFail();
66 | $attendee->delete();
67 | return $attendee;
68 | }
69 |
70 | public function events()
71 | {
72 | return $this->belongsToMany(Event::class);
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/api/app/Models/Event.php:
--------------------------------------------------------------------------------
1 | $data['title'],
24 | 'description' => $data['description'],
25 | 'image' => $data['image'],
26 | 'slug' => Str::slug($data['title']),
27 | 'start_date' => $data['start_date'],
28 | 'end_date' => $data['end_date'],
29 | ]);
30 | }
31 |
32 | public static function getEvent($slug)
33 | {
34 | return self::where('slug', $slug)->firstOrFail();
35 | }
36 |
37 | public static function editEvent($slug)
38 | {
39 | return self::where('slug', $slug)->firstOrFail();
40 | }
41 |
42 | public static function updateEvent($slug, array $data)
43 | {
44 | $event = self::where('slug', $slug)->firstOrFail();
45 |
46 | if (!$event) {
47 | return $event;
48 | }
49 | $event->update([
50 | 'title' => $data['title'],
51 | 'description' => $data['description'],
52 | 'image' => $data['image'],
53 | 'slug' => Str::slug($data['title']),
54 | 'start_date' => $data['start_date'],
55 | 'end_date' => $data['end_date'],
56 | ]);
57 |
58 | return $event;
59 | }
60 |
61 | public static function deleteEvent($slug)
62 | {
63 | $event = self::where('slug', $slug)->firstOrFail();
64 | $event->delete();
65 | }
66 |
67 | public function attendees()
68 | {
69 | return $this->belongsToMany(Attendee::class);
70 | }
71 |
72 | public function tickets()
73 | {
74 | return $this->hasMany(Ticket::class);
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/api/app/Models/Payment.php:
--------------------------------------------------------------------------------
1 | belongsTo(Ticket::class);
20 | }
21 |
22 |
23 | public static function createPayment(array $data)
24 | {
25 | $ticket = Ticket::findOrFail($data['ticket_id']);
26 |
27 | return $ticket->payment()->create([
28 | 'payment_method' => $data['payment_method'],
29 | 'payment_status' => $data['payment_status'] ?? 'pending',
30 | ]);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/api/app/Models/Ticket.php:
--------------------------------------------------------------------------------
1 | get();
18 | $tickets = collect();
19 | foreach ($paidPayments as $payment) {
20 | $tickets = $tickets->merge($payment->tickets);
21 | }
22 |
23 | return $tickets;
24 | }
25 |
26 | public static function createTicket(array $data)
27 | {
28 | $event = Event::findOrFail($data['event_id']);
29 | $user_id = auth()->id();
30 |
31 | $ticket = self::create([
32 | 'ticket_type' => $data['ticket_type'],
33 | 'price' => $data['price'],
34 | 'slug' => Str::slug($event->title . ' ' . $data['ticket_type']),
35 | 'user_id' => $user_id,
36 | 'event_id' => $data['event_id']
37 | ]);
38 | return $ticket;
39 | }
40 |
41 | public static function getTicket($slug)
42 | {
43 | return self::where('slug', $slug)->firstOrFail();
44 | }
45 |
46 | public static function editTicket($slug)
47 | {
48 | return self::where('slug', $slug)->firstOrFail();
49 | }
50 |
51 | public static function updateTicket($slug, array $data)
52 | {
53 | $ticket = self::where('slug', $slug)->firstOrFail();
54 |
55 | $ticket->update([
56 | 'ticket_type' => $data['ticket_type'],
57 | 'price' => $data['price'],
58 | 'slug' => Str::slug($data['ticket_type']),
59 | 'user_id' => $data['user_id'],
60 | ]);
61 |
62 | $event = $ticket->events()->first();
63 | $event->update([
64 | 'start_date' => $data['start_date'],
65 | 'end_date' => $data['end_date'],
66 | ]);
67 |
68 | return $ticket;
69 | }
70 |
71 | public static function deleteTicket($slug)
72 | {
73 | $ticket = self::where('slug', $slug)->firstOrFail();
74 | $ticket->delete();
75 | }
76 |
77 | public function events()
78 | {
79 | return $this->belongsToMany(Event::class)->withPivot('start_date', 'end_date');
80 | }
81 |
82 | public function user()
83 | {
84 | return $this->belongsTo(User::class, 'user_id');
85 | }
86 |
87 | public function payment()
88 | {
89 | return $this->hasOne(Payment::class);
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/api/app/Models/User.php:
--------------------------------------------------------------------------------
1 |
20 | */
21 | protected $fillable = [
22 | 'name',
23 | 'email',
24 | 'password',
25 | 'role'
26 | ];
27 |
28 | // protected $guarded = [];
29 |
30 | /**
31 | * The attributes that should be hidden for serialization.
32 | *
33 | * @var array
34 | */
35 |
36 | public static function FetchUsers()
37 | {
38 | return self::all();
39 | }
40 |
41 | public static function createUser(array $data)
42 | {
43 | return self::create([
44 | 'name' => $data['name'],
45 | 'email' => $data['email'],
46 | 'password' => Hash::make($data['password']),
47 | 'role' => $data['role'],
48 | ]);
49 | }
50 |
51 | public static function userLogin($data)
52 | {
53 | $user = self::where('email', $data['email'])->first();
54 | if (!$user || !Hash::check($data['password'], $user->password)) {
55 | throw ValidationException::withMessages([
56 | 'email' => 'Wrong email password combination.',
57 | ]);
58 | }
59 |
60 | return $user;
61 | }
62 |
63 | public static function getUser($id)
64 | {
65 | return self::where('id', $id)->firstOrFail();
66 | }
67 |
68 | /**
69 | * Undocumented function
70 | *
71 | * @param [type] $id
72 | * @return void
73 | */
74 | public static function editUser($id)
75 | {
76 | return self::where('id', $id)->firstOrFail();
77 | }
78 |
79 | public static function updateUser($id, array $data)
80 | {
81 | $user = self::where('id', $id)->firstOrFail();
82 |
83 | if (!$user) {
84 | return $user;
85 | }
86 | $user->update([
87 | 'name' => $data['name'],
88 | 'email' => $data['email'],
89 | 'password' => Hash::make($data['password']),
90 | 'role' => $data['role'],
91 | ]);
92 |
93 | return $user;
94 | }
95 |
96 | public static function deleteUser($id)
97 | {
98 | $user = self::where('id', $id)->firstOrFail();
99 | $user->delete();
100 | }
101 |
102 | public function tickets()
103 | {
104 | return $this->hasMany(Ticket::class);
105 | }
106 |
107 | protected $hidden = [
108 | 'password',
109 | 'remem
110 | ber_token',
111 | ];
112 |
113 | /**
114 | * The attributes that should be cast.
115 | *
116 | * @var array
117 | */
118 | protected $casts = [
119 | 'email_verified_at' => 'datetime',
120 | ];
121 | }
122 |
--------------------------------------------------------------------------------
/api/app/Providers/AppServiceProvider.php:
--------------------------------------------------------------------------------
1 |
14 | */
15 | protected $policies = [
16 | // 'App\Models\Model' => 'App\Policies\ModelPolicy',
17 | ];
18 |
19 | /**
20 | * Register any authentication / authorization services.
21 | *
22 | * @return void
23 | */
24 | public function boot()
25 | {
26 | $this->registerPolicies();
27 |
28 | //
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/api/app/Providers/BroadcastServiceProvider.php:
--------------------------------------------------------------------------------
1 | >
16 | */
17 | protected $listen = [
18 | Registered::class => [
19 | SendEmailVerificationNotification::class,
20 | ],
21 | ];
22 |
23 | /**
24 | * Register any events for your application.
25 | *
26 | * @return void
27 | */
28 | public function boot()
29 | {
30 | //
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/api/app/Providers/RouteServiceProvider.php:
--------------------------------------------------------------------------------
1 | configureRateLimiting();
39 |
40 | $this->routes(function () {
41 | Route::prefix('api')
42 | ->middleware('api')
43 | ->namespace($this->namespace)
44 | ->group(base_path('routes/api.php'));
45 |
46 | Route::middleware('web')
47 | ->namespace($this->namespace)
48 | ->group(base_path('routes/web.php'));
49 | });
50 | }
51 |
52 | /**
53 | * Configure the rate limiters for the application.
54 | *
55 | * @return void
56 | */
57 | protected function configureRateLimiting()
58 | {
59 | RateLimiter::for('api', function (Request $request) {
60 | return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
61 | });
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/api/artisan:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | make(Illuminate\Contracts\Console\Kernel::class);
34 |
35 | $status = $kernel->handle(
36 | $input = new Symfony\Component\Console\Input\ArgvInput,
37 | new Symfony\Component\Console\Output\ConsoleOutput
38 | );
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Shutdown The Application
43 | |--------------------------------------------------------------------------
44 | |
45 | | Once Artisan has finished running, we will fire off the shutdown events
46 | | so that any final work may be done by the application before we shut
47 | | down the process. This is the last thing to happen to the request.
48 | |
49 | */
50 |
51 | $kernel->terminate($input, $status);
52 |
53 | exit($status);
54 |
--------------------------------------------------------------------------------
/api/bootstrap/app.php:
--------------------------------------------------------------------------------
1 | singleton(
30 | Illuminate\Contracts\Http\Kernel::class,
31 | App\Http\Kernel::class
32 | );
33 |
34 | $app->singleton(
35 | Illuminate\Contracts\Console\Kernel::class,
36 | App\Console\Kernel::class
37 | );
38 |
39 | $app->singleton(
40 | Illuminate\Contracts\Debug\ExceptionHandler::class,
41 | App\Exceptions\Handler::class
42 | );
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Return The Application
47 | |--------------------------------------------------------------------------
48 | |
49 | | This script returns the application instance. The instance is given to
50 | | the calling script so we can separate the building of the instances
51 | | from the actual running of the application and sending responses.
52 | |
53 | */
54 |
55 | return $app;
56 |
--------------------------------------------------------------------------------
/api/bootstrap/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/api/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "laravel/laravel",
3 | "type": "project",
4 | "description": "The Laravel Framework.",
5 | "keywords": ["framework", "laravel"],
6 | "license": "MIT",
7 | "require": {
8 | "php": "^7.3|^8.0",
9 | "fruitcake/laravel-cors": "^2.0",
10 | "guzzlehttp/guzzle": "^7.0.1",
11 | "laravel/framework": "^8.75",
12 | "laravel/sanctum": "^2.11",
13 | "laravel/tinker": "^2.5"
14 | },
15 | "require-dev": {
16 | "facade/ignition": "^2.5",
17 | "fakerphp/faker": "^1.9.1",
18 | "laravel/sail": "^1.0.1",
19 | "mockery/mockery": "^1.4.4",
20 | "nunomaduro/collision": "^5.10",
21 | "phpunit/phpunit": "^9.5.10"
22 | },
23 | "autoload": {
24 | "files": [
25 | "app/Helpers/uploadImage.php"
26 | ],
27 | "psr-4": {
28 | "App\\": "app/",
29 | "Database\\Factories\\": "database/factories/",
30 | "Database\\Seeders\\": "database/seeders/"
31 | }
32 | },
33 | "autoload-dev": {
34 | "psr-4": {
35 | "Tests\\": "tests/"
36 | }
37 | },
38 | "scripts": {
39 | "post-autoload-dump": [
40 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
41 | "@php artisan package:discover --ansi"
42 | ],
43 | "post-update-cmd": [
44 | "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
45 | ],
46 | "post-root-package-install": [
47 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
48 | ],
49 | "post-create-project-cmd": [
50 | "@php artisan key:generate --ansi"
51 | ]
52 | },
53 | "extra": {
54 | "laravel": {
55 | "dont-discover": []
56 | }
57 | },
58 | "config": {
59 | "optimize-autoloader": true,
60 | "preferred-install": "dist",
61 | "sort-packages": true
62 | },
63 | "minimum-stability": "dev",
64 | "prefer-stable": true
65 | }
66 |
--------------------------------------------------------------------------------
/api/config/auth.php:
--------------------------------------------------------------------------------
1 | [
17 | 'guard' => 'web',
18 | 'passwords' => 'users',
19 | ],
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Authentication Guards
24 | |--------------------------------------------------------------------------
25 | |
26 | | Next, you may define every authentication guard for your application.
27 | | Of course, a great default configuration has been defined for you
28 | | here which uses session storage and the Eloquent user provider.
29 | |
30 | | All authentication drivers have a user provider. This defines how the
31 | | users are actually retrieved out of your database or other storage
32 | | mechanisms used by this application to persist your user's data.
33 | |
34 | | Supported: "session"
35 | |
36 | */
37 |
38 | 'guards' => [
39 | 'web' => [
40 | 'driver' => 'session',
41 | 'provider' => 'users',
42 | ],
43 | 'api' => [
44 | 'driver' => 'sanctum',
45 | 'provider' => 'users',
46 | ],
47 | ],
48 |
49 |
50 | /*
51 | |--------------------------------------------------------------------------
52 | | User Providers
53 | |--------------------------------------------------------------------------
54 | |
55 | | All authentication drivers have a user provider. This defines how the
56 | | users are actually retrieved out of your database or other storage
57 | | mechanisms used by this application to persist your user's data.
58 | |
59 | | If you have multiple user tables or models you may configure multiple
60 | | sources which represent each model / table. These sources may then
61 | | be assigned to any extra authentication guards you have defined.
62 | |
63 | | Supported: "database", "eloquent"
64 | |
65 | */
66 |
67 | 'providers' => [
68 | 'users' => [
69 | 'driver' => 'eloquent',
70 | 'model' => App\Models\User::class,
71 | ],
72 |
73 | // 'users' => [
74 | // 'driver' => 'database',
75 | // 'table' => 'users',
76 | // ],
77 | ],
78 |
79 | /*
80 | |--------------------------------------------------------------------------
81 | | Resetting Passwords
82 | |--------------------------------------------------------------------------
83 | |
84 | | You may specify multiple password reset configurations if you have more
85 | | than one user table or model in the application and you want to have
86 | | separate password reset settings based on the specific user types.
87 | |
88 | | The expire time is the number of minutes that each reset token will be
89 | | considered valid. This security feature keeps tokens short-lived so
90 | | they have less time to be guessed. You may change this as needed.
91 | |
92 | */
93 |
94 | 'passwords' => [
95 | 'users' => [
96 | 'provider' => 'users',
97 | 'table' => 'password_resets',
98 | 'expire' => 60,
99 | 'throttle' => 60,
100 | ],
101 | ],
102 |
103 | /*
104 | |--------------------------------------------------------------------------
105 | | Password Confirmation Timeout
106 | |--------------------------------------------------------------------------
107 | |
108 | | Here you may define the amount of seconds before a password confirmation
109 | | times out and the user is prompted to re-enter their password via the
110 | | confirmation screen. By default, the timeout lasts for three hours.
111 | |
112 | */
113 |
114 | 'password_timeout' => 10800,
115 |
116 | ];
117 |
--------------------------------------------------------------------------------
/api/config/broadcasting.php:
--------------------------------------------------------------------------------
1 | env('BROADCAST_DRIVER', 'null'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Broadcast Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the broadcast connections that will be used
26 | | to broadcast events to other systems or over websockets. Samples of
27 | | each available type of connection are provided inside this array.
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'pusher' => [
34 | 'driver' => 'pusher',
35 | 'key' => env('PUSHER_APP_KEY'),
36 | 'secret' => env('PUSHER_APP_SECRET'),
37 | 'app_id' => env('PUSHER_APP_ID'),
38 | 'options' => [
39 | 'cluster' => env('PUSHER_APP_CLUSTER'),
40 | 'useTLS' => true,
41 | ],
42 | ],
43 |
44 | 'ably' => [
45 | 'driver' => 'ably',
46 | 'key' => env('ABLY_KEY'),
47 | ],
48 |
49 | 'redis' => [
50 | 'driver' => 'redis',
51 | 'connection' => 'default',
52 | ],
53 |
54 | 'log' => [
55 | 'driver' => 'log',
56 | ],
57 |
58 | 'null' => [
59 | 'driver' => 'null',
60 | ],
61 |
62 | ],
63 |
64 | ];
65 |
--------------------------------------------------------------------------------
/api/config/cache.php:
--------------------------------------------------------------------------------
1 | env('CACHE_DRIVER', 'file'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Cache Stores
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the cache "stores" for your application as
26 | | well as their drivers. You may even define multiple stores for the
27 | | same cache driver to group types of items stored in your caches.
28 | |
29 | | Supported drivers: "apc", "array", "database", "file",
30 | | "memcached", "redis", "dynamodb", "octane", "null"
31 | |
32 | */
33 |
34 | 'stores' => [
35 |
36 | 'apc' => [
37 | 'driver' => 'apc',
38 | ],
39 |
40 | 'array' => [
41 | 'driver' => 'array',
42 | 'serialize' => false,
43 | ],
44 |
45 | 'database' => [
46 | 'driver' => 'database',
47 | 'table' => 'cache',
48 | 'connection' => null,
49 | 'lock_connection' => null,
50 | ],
51 |
52 | 'file' => [
53 | 'driver' => 'file',
54 | 'path' => storage_path('framework/cache/data'),
55 | ],
56 |
57 | 'memcached' => [
58 | 'driver' => 'memcached',
59 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
60 | 'sasl' => [
61 | env('MEMCACHED_USERNAME'),
62 | env('MEMCACHED_PASSWORD'),
63 | ],
64 | 'options' => [
65 | // Memcached::OPT_CONNECT_TIMEOUT => 2000,
66 | ],
67 | 'servers' => [
68 | [
69 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
70 | 'port' => env('MEMCACHED_PORT', 11211),
71 | 'weight' => 100,
72 | ],
73 | ],
74 | ],
75 |
76 | 'redis' => [
77 | 'driver' => 'redis',
78 | 'connection' => 'cache',
79 | 'lock_connection' => 'default',
80 | ],
81 |
82 | 'dynamodb' => [
83 | 'driver' => 'dynamodb',
84 | 'key' => env('AWS_ACCESS_KEY_ID'),
85 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
86 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
87 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
88 | 'endpoint' => env('DYNAMODB_ENDPOINT'),
89 | ],
90 |
91 | 'octane' => [
92 | 'driver' => 'octane',
93 | ],
94 |
95 | ],
96 |
97 | /*
98 | |--------------------------------------------------------------------------
99 | | Cache Key Prefix
100 | |--------------------------------------------------------------------------
101 | |
102 | | When utilizing a RAM based store such as APC or Memcached, there might
103 | | be other applications utilizing the same cache. So, we'll specify a
104 | | value to get prefixed to all our keys so we can avoid collisions.
105 | |
106 | */
107 |
108 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
109 |
110 | ];
111 |
--------------------------------------------------------------------------------
/api/config/cors.php:
--------------------------------------------------------------------------------
1 | ['api/*', 'sanctum/csrf-cookie'],
19 |
20 | 'allowed_methods' => ['*'],
21 |
22 | 'allowed_origins' => ['*'],
23 |
24 | 'allowed_origins_patterns' => [],
25 |
26 | 'allowed_headers' => ['*'],
27 |
28 | 'exposed_headers' => [],
29 |
30 | 'max_age' => 0,
31 |
32 | 'supports_credentials' => false,
33 |
34 | ];
35 |
--------------------------------------------------------------------------------
/api/config/database.php:
--------------------------------------------------------------------------------
1 | env('DB_CONNECTION', 'mysql'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Database Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here are each of the database connections setup for your application.
26 | | Of course, examples of configuring each database platform that is
27 | | supported by Laravel is shown below to make development simple.
28 | |
29 | |
30 | | All database work in Laravel is done through the PHP PDO facilities
31 | | so make sure you have the driver for your particular database of
32 | | choice installed on your machine before you begin development.
33 | |
34 | */
35 |
36 | 'connections' => [
37 |
38 | 'sqlite' => [
39 | 'driver' => 'sqlite',
40 | 'url' => env('DATABASE_URL'),
41 | 'database' => env('DB_DATABASE', database_path('database.sqlite')),
42 | 'prefix' => '',
43 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
44 | ],
45 |
46 | 'mysql' => [
47 | 'driver' => 'mysql',
48 | 'url' => env('DATABASE_URL'),
49 | 'host' => env('DB_HOST', '127.0.0.1'),
50 | 'port' => env('DB_PORT', '3306'),
51 | 'database' => env('DB_DATABASE', 'forge'),
52 | 'username' => env('DB_USERNAME', 'forge'),
53 | 'password' => env('DB_PASSWORD', ''),
54 | 'unix_socket' => env('DB_SOCKET', ''),
55 | 'charset' => 'utf8mb4',
56 | 'collation' => 'utf8mb4_unicode_ci',
57 | 'prefix' => '',
58 | 'prefix_indexes' => true,
59 | 'strict' => true,
60 | 'engine' => null,
61 | 'options' => extension_loaded('pdo_mysql') ? array_filter([
62 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
63 | ]) : [],
64 | ],
65 |
66 | 'pgsql' => [
67 | 'driver' => 'pgsql',
68 | 'url' => env('DATABASE_URL'),
69 | 'host' => env('DB_HOST', '127.0.0.1'),
70 | 'port' => env('DB_PORT', '5432'),
71 | 'database' => env('DB_DATABASE', 'forge'),
72 | 'username' => env('DB_USERNAME', 'forge'),
73 | 'password' => env('DB_PASSWORD', ''),
74 | 'charset' => 'utf8',
75 | 'prefix' => '',
76 | 'prefix_indexes' => true,
77 | 'schema' => 'public',
78 | 'sslmode' => 'prefer',
79 | ],
80 |
81 | 'sqlsrv' => [
82 | 'driver' => 'sqlsrv',
83 | 'url' => env('DATABASE_URL'),
84 | 'host' => env('DB_HOST', 'localhost'),
85 | 'port' => env('DB_PORT', '1433'),
86 | 'database' => env('DB_DATABASE', 'forge'),
87 | 'username' => env('DB_USERNAME', 'forge'),
88 | 'password' => env('DB_PASSWORD', ''),
89 | 'charset' => 'utf8',
90 | 'prefix' => '',
91 | 'prefix_indexes' => true,
92 | ],
93 |
94 | ],
95 |
96 | /*
97 | |--------------------------------------------------------------------------
98 | | Migration Repository Table
99 | |--------------------------------------------------------------------------
100 | |
101 | | This table keeps track of all the migrations that have already run for
102 | | your application. Using this information, we can determine which of
103 | | the migrations on disk haven't actually been run in the database.
104 | |
105 | */
106 |
107 | 'migrations' => 'migrations',
108 |
109 | /*
110 | |--------------------------------------------------------------------------
111 | | Redis Databases
112 | |--------------------------------------------------------------------------
113 | |
114 | | Redis is an open source, fast, and advanced key-value store that also
115 | | provides a richer body of commands than a typical key-value system
116 | | such as APC or Memcached. Laravel makes it easy to dig right in.
117 | |
118 | */
119 |
120 | 'redis' => [
121 |
122 | 'client' => env('REDIS_CLIENT', 'phpredis'),
123 |
124 | 'options' => [
125 | 'cluster' => env('REDIS_CLUSTER', 'redis'),
126 | 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
127 | ],
128 |
129 | 'default' => [
130 | 'url' => env('REDIS_URL'),
131 | 'host' => env('REDIS_HOST', '127.0.0.1'),
132 | 'password' => env('REDIS_PASSWORD', null),
133 | 'port' => env('REDIS_PORT', '6379'),
134 | 'database' => env('REDIS_DB', '0'),
135 | ],
136 |
137 | 'cache' => [
138 | 'url' => env('REDIS_URL'),
139 | 'host' => env('REDIS_HOST', '127.0.0.1'),
140 | 'password' => env('REDIS_PASSWORD', null),
141 | 'port' => env('REDIS_PORT', '6379'),
142 | 'database' => env('REDIS_CACHE_DB', '1'),
143 | ],
144 |
145 | ],
146 |
147 | ];
148 |
--------------------------------------------------------------------------------
/api/config/filesystems.php:
--------------------------------------------------------------------------------
1 | env('FILESYSTEM_DRIVER', 'local'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Filesystem Disks
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure as many filesystem "disks" as you wish, and you
24 | | may even configure multiple disks of the same driver. Defaults have
25 | | been setup for each driver as an example of the required options.
26 | |
27 | | Supported Drivers: "local", "ftp", "sftp", "s3"
28 | |
29 | */
30 |
31 | 'disks' => [
32 |
33 | 'local' => [
34 | 'driver' => 'local',
35 | 'root' => storage_path('app'),
36 | ],
37 |
38 | 'public' => [
39 | 'driver' => 'local',
40 | 'root' => storage_path('app/public'),
41 | 'url' => env('APP_URL').'/storage',
42 | 'visibility' => 'public',
43 | ],
44 |
45 | 's3' => [
46 | 'driver' => 's3',
47 | 'key' => env('AWS_ACCESS_KEY_ID'),
48 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
49 | 'region' => env('AWS_DEFAULT_REGION'),
50 | 'bucket' => env('AWS_BUCKET'),
51 | 'url' => env('AWS_URL'),
52 | 'endpoint' => env('AWS_ENDPOINT'),
53 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
54 | ],
55 |
56 | ],
57 |
58 | /*
59 | |--------------------------------------------------------------------------
60 | | Symbolic Links
61 | |--------------------------------------------------------------------------
62 | |
63 | | Here you may configure the symbolic links that will be created when the
64 | | `storage:link` Artisan command is executed. The array keys should be
65 | | the locations of the links and the values should be their targets.
66 | |
67 | */
68 |
69 | 'links' => [
70 | public_path('storage') => storage_path('app/public'),
71 | ],
72 |
73 | ];
74 |
--------------------------------------------------------------------------------
/api/config/hashing.php:
--------------------------------------------------------------------------------
1 | 'bcrypt',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Bcrypt Options
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may specify the configuration options that should be used when
26 | | passwords are hashed using the Bcrypt algorithm. This will allow you
27 | | to control the amount of time it takes to hash the given password.
28 | |
29 | */
30 |
31 | 'bcrypt' => [
32 | 'rounds' => env('BCRYPT_ROUNDS', 10),
33 | ],
34 |
35 | /*
36 | |--------------------------------------------------------------------------
37 | | Argon Options
38 | |--------------------------------------------------------------------------
39 | |
40 | | Here you may specify the configuration options that should be used when
41 | | passwords are hashed using the Argon algorithm. These will allow you
42 | | to control the amount of time it takes to hash the given password.
43 | |
44 | */
45 |
46 | 'argon' => [
47 | 'memory' => 65536,
48 | 'threads' => 1,
49 | 'time' => 4,
50 | ],
51 |
52 | ];
53 |
--------------------------------------------------------------------------------
/api/config/logging.php:
--------------------------------------------------------------------------------
1 | env('LOG_CHANNEL', 'stack'),
21 |
22 | /*
23 | |--------------------------------------------------------------------------
24 | | Deprecations Log Channel
25 | |--------------------------------------------------------------------------
26 | |
27 | | This option controls the log channel that should be used to log warnings
28 | | regarding deprecated PHP and library features. This allows you to get
29 | | your application ready for upcoming major versions of dependencies.
30 | |
31 | */
32 |
33 | 'deprecations' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
34 |
35 | /*
36 | |--------------------------------------------------------------------------
37 | | Log Channels
38 | |--------------------------------------------------------------------------
39 | |
40 | | Here you may configure the log channels for your application. Out of
41 | | the box, Laravel uses the Monolog PHP logging library. This gives
42 | | you a variety of powerful log handlers / formatters to utilize.
43 | |
44 | | Available Drivers: "single", "daily", "slack", "syslog",
45 | | "errorlog", "monolog",
46 | | "custom", "stack"
47 | |
48 | */
49 |
50 | 'channels' => [
51 | 'stack' => [
52 | 'driver' => 'stack',
53 | 'channels' => ['single'],
54 | 'ignore_exceptions' => false,
55 | ],
56 |
57 | 'single' => [
58 | 'driver' => 'single',
59 | 'path' => storage_path('logs/laravel.log'),
60 | 'level' => env('LOG_LEVEL', 'debug'),
61 | ],
62 |
63 | 'daily' => [
64 | 'driver' => 'daily',
65 | 'path' => storage_path('logs/laravel.log'),
66 | 'level' => env('LOG_LEVEL', 'debug'),
67 | 'days' => 14,
68 | ],
69 |
70 | 'slack' => [
71 | 'driver' => 'slack',
72 | 'url' => env('LOG_SLACK_WEBHOOK_URL'),
73 | 'username' => 'Laravel Log',
74 | 'emoji' => ':boom:',
75 | 'level' => env('LOG_LEVEL', 'critical'),
76 | ],
77 |
78 | 'papertrail' => [
79 | 'driver' => 'monolog',
80 | 'level' => env('LOG_LEVEL', 'debug'),
81 | 'handler' => SyslogUdpHandler::class,
82 | 'handler_with' => [
83 | 'host' => env('PAPERTRAIL_URL'),
84 | 'port' => env('PAPERTRAIL_PORT'),
85 | ],
86 | ],
87 |
88 | 'stderr' => [
89 | 'driver' => 'monolog',
90 | 'level' => env('LOG_LEVEL', 'debug'),
91 | 'handler' => StreamHandler::class,
92 | 'formatter' => env('LOG_STDERR_FORMATTER'),
93 | 'with' => [
94 | 'stream' => 'php://stderr',
95 | ],
96 | ],
97 |
98 | 'syslog' => [
99 | 'driver' => 'syslog',
100 | 'level' => env('LOG_LEVEL', 'debug'),
101 | ],
102 |
103 | 'errorlog' => [
104 | 'driver' => 'errorlog',
105 | 'level' => env('LOG_LEVEL', 'debug'),
106 | ],
107 |
108 | 'null' => [
109 | 'driver' => 'monolog',
110 | 'handler' => NullHandler::class,
111 | ],
112 |
113 | 'emergency' => [
114 | 'path' => storage_path('logs/laravel.log'),
115 | ],
116 | ],
117 |
118 | ];
119 |
--------------------------------------------------------------------------------
/api/config/mail.php:
--------------------------------------------------------------------------------
1 | env('MAIL_MAILER', 'smtp'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Mailer Configurations
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure all of the mailers used by your application plus
24 | | their respective settings. Several examples have been configured for
25 | | you and you are free to add your own as your application requires.
26 | |
27 | | Laravel supports a variety of mail "transport" drivers to be used while
28 | | sending an e-mail. You will specify which one you are using for your
29 | | mailers below. You are free to add additional mailers as required.
30 | |
31 | | Supported: "smtp", "sendmail", "mailgun", "ses",
32 | | "postmark", "log", "array", "failover"
33 | |
34 | */
35 |
36 | 'mailers' => [
37 | 'smtp' => [
38 | 'transport' => 'smtp',
39 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
40 | 'port' => env('MAIL_PORT', 587),
41 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
42 | 'username' => env('MAIL_USERNAME'),
43 | 'password' => env('MAIL_PASSWORD'),
44 | 'timeout' => null,
45 | 'auth_mode' => null,
46 | ],
47 |
48 | 'ses' => [
49 | 'transport' => 'ses',
50 | ],
51 |
52 | 'mailgun' => [
53 | 'transport' => 'mailgun',
54 | ],
55 |
56 | 'postmark' => [
57 | 'transport' => 'postmark',
58 | ],
59 |
60 | 'sendmail' => [
61 | 'transport' => 'sendmail',
62 | 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -t -i'),
63 | ],
64 |
65 | 'log' => [
66 | 'transport' => 'log',
67 | 'channel' => env('MAIL_LOG_CHANNEL'),
68 | ],
69 |
70 | 'array' => [
71 | 'transport' => 'array',
72 | ],
73 |
74 | 'failover' => [
75 | 'transport' => 'failover',
76 | 'mailers' => [
77 | 'smtp',
78 | 'log',
79 | ],
80 | ],
81 | ],
82 |
83 | /*
84 | |--------------------------------------------------------------------------
85 | | Global "From" Address
86 | |--------------------------------------------------------------------------
87 | |
88 | | You may wish for all e-mails sent by your application to be sent from
89 | | the same address. Here, you may specify a name and address that is
90 | | used globally for all e-mails that are sent by your application.
91 | |
92 | */
93 |
94 | 'from' => [
95 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
96 | 'name' => env('MAIL_FROM_NAME', 'Example'),
97 | ],
98 |
99 | /*
100 | |--------------------------------------------------------------------------
101 | | Markdown Mail Settings
102 | |--------------------------------------------------------------------------
103 | |
104 | | If you are using Markdown based email rendering, you may configure your
105 | | theme and component paths here, allowing you to customize the design
106 | | of the emails. Or, you may simply stick with the Laravel defaults!
107 | |
108 | */
109 |
110 | 'markdown' => [
111 | 'theme' => 'default',
112 |
113 | 'paths' => [
114 | resource_path('views/vendor/mail'),
115 | ],
116 | ],
117 |
118 | ];
119 |
--------------------------------------------------------------------------------
/api/config/queue.php:
--------------------------------------------------------------------------------
1 | env('QUEUE_CONNECTION', 'sync'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Queue Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure the connection information for each server that
24 | | is used by your application. A default configuration has been added
25 | | for each back-end shipped with Laravel. You are free to add more.
26 | |
27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'sync' => [
34 | 'driver' => 'sync',
35 | ],
36 |
37 | 'database' => [
38 | 'driver' => 'database',
39 | 'table' => 'jobs',
40 | 'queue' => 'default',
41 | 'retry_after' => 90,
42 | 'after_commit' => false,
43 | ],
44 |
45 | 'beanstalkd' => [
46 | 'driver' => 'beanstalkd',
47 | 'host' => 'localhost',
48 | 'queue' => 'default',
49 | 'retry_after' => 90,
50 | 'block_for' => 0,
51 | 'after_commit' => false,
52 | ],
53 |
54 | 'sqs' => [
55 | 'driver' => 'sqs',
56 | 'key' => env('AWS_ACCESS_KEY_ID'),
57 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
58 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
59 | 'queue' => env('SQS_QUEUE', 'default'),
60 | 'suffix' => env('SQS_SUFFIX'),
61 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
62 | 'after_commit' => false,
63 | ],
64 |
65 | 'redis' => [
66 | 'driver' => 'redis',
67 | 'connection' => 'default',
68 | 'queue' => env('REDIS_QUEUE', 'default'),
69 | 'retry_after' => 90,
70 | 'block_for' => null,
71 | 'after_commit' => false,
72 | ],
73 |
74 | ],
75 |
76 | /*
77 | |--------------------------------------------------------------------------
78 | | Failed Queue Jobs
79 | |--------------------------------------------------------------------------
80 | |
81 | | These options configure the behavior of failed queue job logging so you
82 | | can control which database and table are used to store the jobs that
83 | | have failed. You may change them to any database / table you wish.
84 | |
85 | */
86 |
87 | 'failed' => [
88 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
89 | 'database' => env('DB_CONNECTION', 'mysql'),
90 | 'table' => 'failed_jobs',
91 | ],
92 |
93 | ];
94 |
--------------------------------------------------------------------------------
/api/config/sanctum.php:
--------------------------------------------------------------------------------
1 | explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
17 | '%s%s',
18 | 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
19 | env('APP_URL') ? ','.parse_url(env('APP_URL'), PHP_URL_HOST) : ''
20 | ))),
21 |
22 | /*
23 | |--------------------------------------------------------------------------
24 | | Sanctum Guards
25 | |--------------------------------------------------------------------------
26 | |
27 | | This array contains the authentication guards that will be checked when
28 | | Sanctum is trying to authenticate a request. If none of these guards
29 | | are able to authenticate the request, Sanctum will use the bearer
30 | | token that's present on an incoming request for authentication.
31 | |
32 | */
33 |
34 | 'guard' => ['web'],
35 |
36 | /*
37 | |--------------------------------------------------------------------------
38 | | Expiration Minutes
39 | |--------------------------------------------------------------------------
40 | |
41 | | This value controls the number of minutes until an issued token will be
42 | | considered expired. If this value is null, personal access tokens do
43 | | not expire. This won't tweak the lifetime of first-party sessions.
44 | |
45 | */
46 |
47 | 'expiration' => null,
48 |
49 | /*
50 | |--------------------------------------------------------------------------
51 | | Sanctum Middleware
52 | |--------------------------------------------------------------------------
53 | |
54 | | When authenticating your first-party SPA with Sanctum you may need to
55 | | customize some of the middleware Sanctum uses while processing the
56 | | request. You may change the middleware listed below as required.
57 | |
58 | */
59 |
60 | 'middleware' => [
61 | 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
62 | 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
63 | ],
64 |
65 | ];
66 |
--------------------------------------------------------------------------------
/api/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => env('MAILGUN_DOMAIN'),
19 | 'secret' => env('MAILGUN_SECRET'),
20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
21 | ],
22 |
23 | 'postmark' => [
24 | 'token' => env('POSTMARK_TOKEN'),
25 | ],
26 |
27 | 'ses' => [
28 | 'key' => env('AWS_ACCESS_KEY_ID'),
29 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
30 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
31 | ],
32 |
33 | ];
34 |
--------------------------------------------------------------------------------
/api/config/view.php:
--------------------------------------------------------------------------------
1 | [
17 | resource_path('views'),
18 | ],
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Compiled View Path
23 | |--------------------------------------------------------------------------
24 | |
25 | | This option determines where all the compiled Blade templates will be
26 | | stored for your application. Typically, this is within the storage
27 | | directory. However, as usual, you are free to change this value.
28 | |
29 | */
30 |
31 | 'compiled' => env(
32 | 'VIEW_COMPILED_PATH',
33 | realpath(storage_path('framework/views'))
34 | ),
35 |
36 | ];
37 |
--------------------------------------------------------------------------------
/api/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite*
2 |
--------------------------------------------------------------------------------
/api/database/factories/UserFactory.php:
--------------------------------------------------------------------------------
1 | $this->faker->name(),
19 | 'email' => $this->faker->unique()->safeEmail(),
20 | 'email_verified_at' => now(),
21 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
22 | 'remember_token' => Str::random(10),
23 | ];
24 | }
25 |
26 | /**
27 | * Indicate that the model's email address should be unverified.
28 | *
29 | * @return \Illuminate\Database\Eloquent\Factories\Factory
30 | */
31 | public function unverified()
32 | {
33 | return $this->state(function (array $attributes) {
34 | return [
35 | 'email_verified_at' => null,
36 | ];
37 | });
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/api/database/migrations/2014_10_12_000000_create_users_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('name');
19 | $table->string('email')->unique();
20 | $table->timestamp('email_verified_at')->nullable();
21 | $table->string('password');
22 | $table->string('role');
23 | $table->rememberToken();
24 | $table->timestamps();
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | *
31 | * @return void
32 | */
33 | public function down()
34 | {
35 | Schema::dropIfExists('users');
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/api/database/migrations/2014_10_12_100000_create_password_resets_table.php:
--------------------------------------------------------------------------------
1 | string('email')->index();
18 | $table->string('token');
19 | $table->timestamp('created_at')->nullable();
20 | });
21 | }
22 |
23 | /**
24 | * Reverse the migrations.
25 | *
26 | * @return void
27 | */
28 | public function down()
29 | {
30 | Schema::dropIfExists('password_resets');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/api/database/migrations/2019_08_19_000000_create_failed_jobs_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('uuid')->unique();
19 | $table->text('connection');
20 | $table->text('queue');
21 | $table->longText('payload');
22 | $table->longText('exception');
23 | $table->timestamp('failed_at')->useCurrent();
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | *
30 | * @return void
31 | */
32 | public function down()
33 | {
34 | Schema::dropIfExists('failed_jobs');
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/api/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->morphs('tokenable');
19 | $table->string('name');
20 | $table->string('token', 64)->unique();
21 | $table->text('abilities')->nullable();
22 | $table->timestamp('last_used_at')->nullable();
23 | $table->timestamps();
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | *
30 | * @return void
31 | */
32 | public function down()
33 | {
34 | Schema::dropIfExists('personal_access_tokens');
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/api/database/migrations/2023_07_12_134943_create_attendees_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('name');
19 | $table->string('email')->unique();
20 | $table->string('phone')->unique();
21 | $table->string('slug');
22 | $table->timestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | *
29 | * @return void
30 | */
31 | public function down()
32 | {
33 | Schema::dropIfExists('attendees');
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/api/database/migrations/2023_07_12_135138_create_events_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('title')->unique();
19 | $table->text('description');
20 | $table->string('slug');
21 | $table->string('image');
22 | $table->datetime('start_date');
23 | $table->datetime('end_date');
24 | $table->timestamps();
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | *
31 | * @return void
32 | */
33 | public function down()
34 | {
35 | Schema::dropIfExists('events');
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/api/database/migrations/2024_03_03_082941_create_payments_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->foreignId('ticket_id')->constrained()->onDelete('cascade');
19 | $table->string('payment_method');
20 | $table->enum('payment_status', ['pending', 'completed', 'canceled'])->default('pending');
21 | $table->timestamps();
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | *
28 | * @return void
29 | */
30 | public function down()
31 | {
32 | Schema::dropIfExists('payments');
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/api/database/migrations/2024_03_10_104226_create_tickets_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('ticket_type');
19 | $table->integer('price');
20 | $table->foreignId('event_id')->constrained()->onDelete('cascade');
21 | $table->foreignId('user_id')->constrained()->onDelete('cascade');
22 | $table->string('slug');
23 | $table->timestamps();
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | *
30 | * @return void
31 | */
32 | public function down()
33 | {
34 | Schema::dropIfExists('tickets');
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/api/database/seeders/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | create();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/api/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "dev": "npm run development",
5 | "development": "mix",
6 | "watch": "mix watch",
7 | "watch-poll": "mix watch -- --watch-options-poll=1000",
8 | "hot": "mix watch --hot",
9 | "prod": "npm run production",
10 | "production": "mix --production"
11 | },
12 | "devDependencies": {
13 | "axios": "^0.21",
14 | "laravel-mix": "^6.0.6",
15 | "lodash": "^4.17.19",
16 | "postcss": "^8.1.14"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/api/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 | ./tests/Unit
10 |
11 |
12 | ./tests/Feature
13 |
14 |
15 |
16 |
17 | ./app
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/api/public/.htaccess:
--------------------------------------------------------------------------------
1 |
2 |
3 | Options -MultiViews -Indexes
4 |
5 |
6 | RewriteEngine On
7 |
8 | # Handle Authorization Header
9 | RewriteCond %{HTTP:Authorization} .
10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
11 |
12 | # Redirect Trailing Slashes If Not A Folder...
13 | RewriteCond %{REQUEST_FILENAME} !-d
14 | RewriteCond %{REQUEST_URI} (.+)/$
15 | RewriteRule ^ %1 [L,R=301]
16 |
17 | # Send Requests To Front Controller...
18 | RewriteCond %{REQUEST_FILENAME} !-d
19 | RewriteCond %{REQUEST_FILENAME} !-f
20 | RewriteRule ^ index.php [L]
21 |
22 |
--------------------------------------------------------------------------------
/api/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FREDVUNI/laravel-vue-events/0b8d2dbdc81ae86f96722c22347ef8483a1e7eee/api/public/favicon.ico
--------------------------------------------------------------------------------
/api/public/index.php:
--------------------------------------------------------------------------------
1 | make(Kernel::class);
50 |
51 | $response = $kernel->handle(
52 | $request = Request::capture()
53 | )->send();
54 |
55 | $kernel->terminate($request, $response);
56 |
--------------------------------------------------------------------------------
/api/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/api/public/uploads/events/1706354060_65b4e58cbbaeb.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FREDVUNI/laravel-vue-events/0b8d2dbdc81ae86f96722c22347ef8483a1e7eee/api/public/uploads/events/1706354060_65b4e58cbbaeb.jpg
--------------------------------------------------------------------------------
/api/public/uploads/events/1706433566_65b61c1ed238f.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FREDVUNI/laravel-vue-events/0b8d2dbdc81ae86f96722c22347ef8483a1e7eee/api/public/uploads/events/1706433566_65b61c1ed238f.png
--------------------------------------------------------------------------------
/api/resources/css/app.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FREDVUNI/laravel-vue-events/0b8d2dbdc81ae86f96722c22347ef8483a1e7eee/api/resources/css/app.css
--------------------------------------------------------------------------------
/api/resources/js/app.js:
--------------------------------------------------------------------------------
1 | require('./bootstrap');
2 |
--------------------------------------------------------------------------------
/api/resources/js/bootstrap.js:
--------------------------------------------------------------------------------
1 | window._ = require('lodash');
2 |
3 | /**
4 | * We'll load the axios HTTP library which allows us to easily issue requests
5 | * to our Laravel back-end. This library automatically handles sending the
6 | * CSRF token as a header based on the value of the "XSRF" token cookie.
7 | */
8 |
9 | window.axios = require('axios');
10 |
11 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
12 |
13 | /**
14 | * Echo exposes an expressive API for subscribing to channels and listening
15 | * for events that are broadcast by Laravel. Echo and event broadcasting
16 | * allows your team to easily build robust real-time web applications.
17 | */
18 |
19 | // import Echo from 'laravel-echo';
20 |
21 | // window.Pusher = require('pusher-js');
22 |
23 | // window.Echo = new Echo({
24 | // broadcaster: 'pusher',
25 | // key: process.env.MIX_PUSHER_APP_KEY,
26 | // cluster: process.env.MIX_PUSHER_APP_CLUSTER,
27 | // forceTLS: true
28 | // });
29 |
--------------------------------------------------------------------------------
/api/resources/lang/en/auth.php:
--------------------------------------------------------------------------------
1 | 'These credentials do not match our records.',
17 | 'password' => 'The provided password is incorrect.',
18 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
19 |
20 | ];
21 |
--------------------------------------------------------------------------------
/api/resources/lang/en/pagination.php:
--------------------------------------------------------------------------------
1 | '« Previous',
17 | 'next' => 'Next »',
18 |
19 | ];
20 |
--------------------------------------------------------------------------------
/api/resources/lang/en/passwords.php:
--------------------------------------------------------------------------------
1 | 'Your password has been reset!',
17 | 'sent' => 'We have emailed your password reset link!',
18 | 'throttled' => 'Please wait before retrying.',
19 | 'token' => 'This password reset token is invalid.',
20 | 'user' => "We can't find a user with that email address.",
21 |
22 | ];
23 |
--------------------------------------------------------------------------------
/api/routes/api.php:
--------------------------------------------------------------------------------
1 | "auth"], function () {
24 | Route::post('signup', [AuthController::class, 'signup']);
25 | Route::post('signin', [AuthController::class, 'signin']);
26 |
27 | Route::group(["middleware" => ["auth:sanctum"]], function () {
28 | Route::get('user', function (Request $request) {
29 | return $request->user();
30 | });
31 | Route::post('logout', [AuthController::class, 'logout']);
32 | Route::get('/user', [AuthController::class, 'user']);
33 | });
34 | });
35 |
36 | //users
37 | Route::group(["prefix" => "users"], function () {
38 | Route::group(["middleware" => ["auth:sanctum"]], function () {
39 | Route::get("/", [UserController::class, 'users']);
40 | Route::get('/users-count', [UserController::class, 'count']);
41 | Route::get('show/{id}', [UserController::class, 'show']);
42 | Route::get('edit/{id}', [UserController::class, 'edit']);
43 | Route::patch('update/{id}', [UserController::class, 'update']);
44 | Route::delete('delete/{id}', [UserController::class, 'delete']);
45 | });
46 | });
47 |
48 | //events
49 | Route::group(["prefix" => "events"], function () {
50 | Route::get("/", [EventController::class, 'events']);
51 |
52 | Route::group(["middleware" => ["auth:sanctum"]], function () {
53 | Route::post('/', [EventController::class, 'store']);
54 | Route::get('/events-count', [EventController::class, 'count']);
55 | Route::get('/upcoming-events-count', [EventController::class, 'countUpcomingEvents']);
56 | Route::get('show/{slug}', [EventController::class, 'show']);
57 | Route::get('edit/{slug}', [EventController::class, 'edit']);
58 | Route::patch('update/{slug}', [EventController::class, 'update']);
59 | Route::delete('delete/{slug}', [EventController::class, 'delete']);
60 | });
61 | });
62 |
63 | //attendees
64 | Route::group(["prefix" => "attendees"], function () {
65 | Route::group(["middleware" => ["auth:sanctum"]], function () {
66 | Route::get("/", [AttendeeController::class, 'attendees']);
67 | Route::post('/', [AttendeeController::class, 'store']);
68 | Route::get('show/{slug}', [AttendeeController::class, 'show']);
69 | Route::get('edit/{slug}', [AttendeeController::class, 'edit']);
70 | Route::patch('update/{slug}', [AttendeeController::class, 'update']);
71 | Route::delete('delete/{slug}', [AttendeeController::class, 'delete']);
72 | });
73 | });
74 |
75 | //tickets
76 | Route::group(["prefix" => "tickets"], function () {
77 | Route::group(["middleware" => ["auth:sanctum"]], function () {
78 | Route::post('/', [TicketController::class, 'store']);
79 | Route::get("/", [TicketController::class, 'tickets']);
80 | Route::get('/sold-tickets-count', [TicketController::class, 'count']);
81 | Route::get('show/{slug}', [TicketController::class, 'show']);
82 | Route::get('edit/{slug}', [TicketController::class, 'edit']);
83 | Route::patch('update/{slug}', [TicketController::class, 'update']);
84 | Route::delete('delete/{slug}', [TicketController::class, 'delete']);
85 | });
86 | });
87 |
88 | // Payments
89 | Route::group(["prefix" => "payments"], function () {
90 | Route::group(["middleware" => ["auth:sanctum"]], function () {
91 | Route::post('/', [PaymentController::class, 'store']);
92 | Route::get('/', [PaymentController::class, 'index']);
93 | Route::get('/{slug}', [PaymentController::class, 'show']);
94 | Route::patch('/{slug}', [PaymentController::class, 'update']);
95 | Route::delete('/{slug}', [PaymentController::class, 'cancel']);
96 | });
97 | });
98 |
--------------------------------------------------------------------------------
/api/routes/channels.php:
--------------------------------------------------------------------------------
1 | id === (int) $id;
18 | });
19 |
--------------------------------------------------------------------------------
/api/routes/console.php:
--------------------------------------------------------------------------------
1 | comment(Inspiring::quote());
19 | })->purpose('Display an inspiring quote');
20 |
--------------------------------------------------------------------------------
/api/routes/web.php:
--------------------------------------------------------------------------------
1 |
8 | */
9 |
10 | $uri = urldecode(
11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? ''
12 | );
13 |
14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the
15 | // built-in PHP web server. This provides a convenient way to test a Laravel
16 | // application without having installed a "real" web server software here.
17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
18 | return false;
19 | }
20 |
21 | require_once __DIR__.'/public/index.php';
22 |
--------------------------------------------------------------------------------
/api/storage/app/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !public/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/api/storage/app/public/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/api/storage/framework/.gitignore:
--------------------------------------------------------------------------------
1 | compiled.php
2 | config.php
3 | down
4 | events.scanned.php
5 | maintenance.php
6 | routes.php
7 | routes.scanned.php
8 | schedule-*
9 | services.json
10 |
--------------------------------------------------------------------------------
/api/storage/framework/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !data/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/api/storage/framework/cache/data/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/api/storage/framework/sessions/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/api/storage/framework/testing/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/api/storage/framework/views/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/api/storage/logs/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/api/tests/CreatesApplication.php:
--------------------------------------------------------------------------------
1 | make(Kernel::class)->bootstrap();
19 |
20 | return $app;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/api/tests/Feature/ExampleTest.php:
--------------------------------------------------------------------------------
1 | get('/');
18 |
19 | $response->assertStatus(200);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/api/tests/TestCase.php:
--------------------------------------------------------------------------------
1 | assertTrue(true);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/api/webpack.mix.js:
--------------------------------------------------------------------------------
1 | const mix = require('laravel-mix');
2 |
3 | /*
4 | |--------------------------------------------------------------------------
5 | | Mix Asset Management
6 | |--------------------------------------------------------------------------
7 | |
8 | | Mix provides a clean, fluent API for defining some Webpack build steps
9 | | for your Laravel applications. By default, we are compiling the CSS
10 | | file for the application as well as bundling up all the JS files.
11 | |
12 | */
13 |
14 | mix.js('resources/js/app.js', 'public/js')
15 | .postCss('resources/css/app.css', 'public/css', [
16 | //
17 | ]);
18 |
--------------------------------------------------------------------------------
/landing/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | .DS_Store
12 | dist
13 | dist-ssr
14 | coverage
15 | *.local
16 |
17 | /cypress/videos/
18 | /cypress/screenshots/
19 |
20 | # Editor directories and files
21 | .vscode/*
22 | !.vscode/extensions.json
23 | .idea
24 | *.suo
25 | *.ntvs*
26 | *.njsproj
27 | *.sln
28 | *.sw?
29 |
--------------------------------------------------------------------------------
/landing/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
3 | }
4 |
--------------------------------------------------------------------------------
/landing/README.md:
--------------------------------------------------------------------------------
1 | # events admin
2 |
3 | This template should help get you started developing with Vue 3 in Vite.
4 |
5 | ## Recommended IDE Setup
6 |
7 | [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
8 |
9 | ## Customize configuration
10 |
11 | See [Vite Configuration Reference](https://vitejs.dev/config/).
12 |
13 | ## Project Setup
14 |
15 | ```sh
16 | npm install
17 | ```
18 |
19 | ### Compile and Hot-Reload for Development
20 |
21 | ```sh
22 | npm run dev
23 | ```
24 |
25 | ### Compile and Minify for Production
26 |
27 | ```sh
28 | npm run build
29 | ```
30 |
31 | ### Run Unit Tests with [Vitest](https://vitest.dev/)
32 |
33 | ```sh
34 | npm run test:unit
35 | ```
36 |
--------------------------------------------------------------------------------
/landing/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Events
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/landing/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "events-landing",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "vite",
7 | "build": "vite build",
8 | "preview": "vite preview",
9 | "test:unit": "vitest"
10 | },
11 | "dependencies": {
12 | "axios": "^1.6.3",
13 | "flowbite": "^1.6.6",
14 | "pinia": "^2.1.3",
15 | "vue": "^3.3.4",
16 | "vue-router": "^4.2.2"
17 | },
18 | "devDependencies": {
19 | "@vitejs/plugin-vue": "^4.2.3",
20 | "@vue/test-utils": "^2.3.2",
21 | "autoprefixer": "^10.4.14",
22 | "jsdom": "^22.1.0",
23 | "postcss": "^8.4.24",
24 | "tailwindcss": "^3.3.2",
25 | "vite": "^4.3.9",
26 | "vitest": "^0.32.0"
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/landing/postcss.config.js:
--------------------------------------------------------------------------------
1 | /* eslint-env node */
2 | module.exports = {
3 | plugins: [
4 | require("postcss-import"),
5 | require("tailwindcss"),
6 | require("autoprefixer"),
7 | ],
8 | };
9 |
--------------------------------------------------------------------------------
/landing/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FREDVUNI/laravel-vue-events/0b8d2dbdc81ae86f96722c22347ef8483a1e7eee/landing/public/favicon.ico
--------------------------------------------------------------------------------
/landing/public/images/dance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FREDVUNI/laravel-vue-events/0b8d2dbdc81ae86f96722c22347ef8483a1e7eee/landing/public/images/dance.png
--------------------------------------------------------------------------------
/landing/src/App.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/landing/src/assets/base.css:
--------------------------------------------------------------------------------
1 | /* color palette from */
2 | :root {
3 | --vt-c-white: #ffffff;
4 | --vt-c-white-soft: #f8f8f8;
5 | --vt-c-white-mute: #f2f2f2;
6 |
7 | --vt-c-black: #181818;
8 | --vt-c-black-soft: #222222;
9 | --vt-c-black-mute: #282828;
10 |
11 | --vt-c-indigo: #2c3e50;
12 |
13 | --vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
14 | --vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
15 | --vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
16 | --vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);
17 |
18 | --vt-c-text-light-1: var(--vt-c-indigo);
19 | --vt-c-text-light-2: rgba(60, 60, 60, 0.66);
20 | --vt-c-text-dark-1: var(--vt-c-white);
21 | --vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
22 | }
23 |
24 | /* semantic color variables for this project */
25 | :root {
26 | --color-background: var(--vt-c-white);
27 | --color-background-soft: var(--vt-c-white-soft);
28 | --color-background-mute: var(--vt-c-white-mute);
29 |
30 | --color-border: var(--vt-c-divider-light-2);
31 | --color-border-hover: var(--vt-c-divider-light-1);
32 |
33 | --color-heading: var(--vt-c-text-light-1);
34 | --color-text: var(--vt-c-text-light-1);
35 |
36 | --section-gap: 160px;
37 | }
38 |
39 | @media (prefers-color-scheme: dark) {
40 | :root {
41 | --color-background: var(--vt-c-black);
42 | --color-background-soft: var(--vt-c-black-soft);
43 | --color-background-mute: var(--vt-c-black-mute);
44 |
45 | --color-border: var(--vt-c-divider-dark-2);
46 | --color-border-hover: var(--vt-c-divider-dark-1);
47 |
48 | --color-heading: var(--vt-c-text-dark-1);
49 | --color-text: var(--vt-c-text-dark-2);
50 | }
51 | }
52 |
53 | *,
54 | *::before,
55 | *::after {
56 | box-sizing: border-box;
57 | margin: 0;
58 | font-weight: normal;
59 | }
60 |
61 | body {
62 | min-height: 100vh;
63 | color: var(--color-text);
64 | background: var(--color-background);
65 | transition: color 0.5s, background-color 0.5s;
66 | line-height: 1.6;
67 | font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
68 | Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
69 | font-size: 15px;
70 | text-rendering: optimizeLegibility;
71 | -webkit-font-smoothing: antialiased;
72 | -moz-osx-font-smoothing: grayscale;
73 | }
74 |
--------------------------------------------------------------------------------
/landing/src/assets/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/landing/src/assets/main.css:
--------------------------------------------------------------------------------
1 | @import './base.css';
2 | @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');
3 |
4 | body{
5 | font-family: 'Poppins', sans-serif;
6 | }
7 |
--------------------------------------------------------------------------------
/landing/src/components/__tests__/HelloWorld.spec.js:
--------------------------------------------------------------------------------
1 | import { describe, it, expect } from 'vitest'
2 |
3 | import { mount } from '@vue/test-utils'
4 | import HelloWorld from '../HelloWorld.vue'
5 |
6 | describe('HelloWorld', () => {
7 | it('renders properly', () => {
8 | const wrapper = mount(HelloWorld, { props: { msg: 'Hello Vitest' } })
9 | expect(wrapper.text()).toContain('Hello Vitest')
10 | })
11 | })
12 |
--------------------------------------------------------------------------------
/landing/src/components/icons/IconCommunity.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/landing/src/components/icons/IconDocumentation.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/landing/src/components/icons/IconEcosystem.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/landing/src/components/icons/IconSupport.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/landing/src/components/icons/IconTooling.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
19 |
20 |
--------------------------------------------------------------------------------
/landing/src/index.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
--------------------------------------------------------------------------------
/landing/src/main.js:
--------------------------------------------------------------------------------
1 | import "./assets/main.css";
2 | import "./index.css";
3 |
4 | import { createApp } from "vue";
5 | import { createPinia } from "pinia";
6 |
7 | import App from "./App.vue";
8 | import router from "./router";
9 |
10 | const app = createApp(App);
11 |
12 | app.use(createPinia());
13 | app.use(router);
14 |
15 | app.mount("#app");
16 |
--------------------------------------------------------------------------------
/landing/src/router/index.js:
--------------------------------------------------------------------------------
1 | import { createRouter, createWebHistory } from "vue-router";
2 | import HomeView from "../views/HomeView.vue";
3 |
4 | const router = createRouter({
5 | history: createWebHistory(import.meta.env.BASE_URL),
6 | routes: [
7 | {
8 | path: "/",
9 | name: "home",
10 | component: HomeView,
11 | },
12 | ],
13 | });
14 |
15 | export default router;
16 |
--------------------------------------------------------------------------------
/landing/src/stores/counter.js:
--------------------------------------------------------------------------------
1 | import { ref, computed } from 'vue'
2 | import { defineStore } from 'pinia'
3 |
4 | export const useCounterStore = defineStore('counter', () => {
5 | const count = ref(0)
6 | const doubleCount = computed(() => count.value * 2)
7 | function increment() {
8 | count.value++
9 | }
10 |
11 | return { count, doubleCount, increment }
12 | })
13 |
--------------------------------------------------------------------------------
/landing/src/views/HomeView.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/landing/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /* eslint-env node */
2 |
3 | const plugin = require("tailwindcss/plugin");
4 |
5 | module.exports = {
6 | content: ["./index.html", "./src/**/*.{vue,js,ts,jsx,tsx}"],
7 | };
8 |
--------------------------------------------------------------------------------
/landing/vite.config.js:
--------------------------------------------------------------------------------
1 | import { fileURLToPath, URL } from 'node:url'
2 |
3 | import { defineConfig } from 'vite'
4 | import vue from '@vitejs/plugin-vue'
5 |
6 | // https://vitejs.dev/config/
7 | export default defineConfig({
8 | plugins: [
9 | vue(),
10 | ],
11 | resolve: {
12 | alias: {
13 | '@': fileURLToPath(new URL('./src', import.meta.url))
14 | }
15 | }
16 | })
17 |
--------------------------------------------------------------------------------
/landing/vitest.config.js:
--------------------------------------------------------------------------------
1 | import { fileURLToPath } from 'node:url'
2 | import { mergeConfig } from 'vite'
3 | import { configDefaults, defineConfig } from 'vitest/config'
4 | import viteConfig from './vite.config'
5 |
6 | export default mergeConfig(
7 | viteConfig,
8 | defineConfig({
9 | test: {
10 | environment: 'jsdom',
11 | exclude: [...configDefaults.exclude, 'e2e/*'],
12 | root: fileURLToPath(new URL('./', import.meta.url)),
13 | transformMode: {
14 | web: [/\.[jt]sx$/]
15 | }
16 | }
17 | })
18 | )
19 |
--------------------------------------------------------------------------------