added event image and db
@ -14,54 +14,21 @@ class EventController extends Controller
|
|||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$event = Event::get();
|
$event = Event::get();
|
||||||
|
$data = array();
|
||||||
|
if ($event) {
|
||||||
|
foreach ($event as $e) {
|
||||||
|
$data[] = array(
|
||||||
|
'id' => $e->id,
|
||||||
|
'title' => $e->title,
|
||||||
|
'description' => $e->description,
|
||||||
|
'image' => asset('public/uploads/event/' . $e->image),
|
||||||
|
'location' => $e->location,
|
||||||
|
'hosted_by' => $e->hosted_by,
|
||||||
|
'date' => date("d", strtotime($e->date)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
return response($event, 200);
|
return response($event, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for creating a new resource.
|
|
||||||
*/
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Store a newly created resource in storage.
|
|
||||||
*/
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Display the specified resource.
|
|
||||||
*/
|
|
||||||
public function show(Event $event)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for editing the specified resource.
|
|
||||||
*/
|
|
||||||
public function edit(Event $event)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the specified resource in storage.
|
|
||||||
*/
|
|
||||||
public function update(Request $request, Event $event)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the specified resource from storage.
|
|
||||||
*/
|
|
||||||
public function destroy(Event $event)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,10 @@ public function up(): void
|
|||||||
$table->string('title');
|
$table->string('title');
|
||||||
$table->text('description');
|
$table->text('description');
|
||||||
$table->string('location');
|
$table->string('location');
|
||||||
|
$table->string('image')->nullable();
|
||||||
|
$table->string('location');
|
||||||
$table->string('hosted_by');
|
$table->string('hosted_by');
|
||||||
|
$table->date('date')->nullable();
|
||||||
$table->timestamps(); // Created at and Updated at columns
|
$table->timestamps(); // Created at and Updated at columns
|
||||||
$table->softDeletes(); // Deleted at column for soft deletes
|
$table->softDeletes(); // Deleted at column for soft deletes
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
-- https://www.phpmyadmin.net/
|
-- https://www.phpmyadmin.net/
|
||||||
--
|
--
|
||||||
-- Host: 127.0.0.1
|
-- Host: 127.0.0.1
|
||||||
-- Generation Time: Jan 03, 2024 at 08:55 AM
|
-- Generation Time: Jan 03, 2024 at 09:21 AM
|
||||||
-- Server version: 10.4.27-MariaDB
|
-- Server version: 10.4.27-MariaDB
|
||||||
-- PHP Version: 8.2.0
|
-- PHP Version: 8.2.0
|
||||||
|
|
||||||
@ -221,8 +221,10 @@ CREATE TABLE `events` (
|
|||||||
`id` bigint(20) UNSIGNED NOT NULL,
|
`id` bigint(20) UNSIGNED NOT NULL,
|
||||||
`title` varchar(255) NOT NULL,
|
`title` varchar(255) NOT NULL,
|
||||||
`description` text NOT NULL,
|
`description` text NOT NULL,
|
||||||
|
`image` varchar(255) DEFAULT NULL,
|
||||||
`location` varchar(255) NOT NULL,
|
`location` varchar(255) NOT NULL,
|
||||||
`hosted_by` varchar(255) NOT NULL,
|
`hosted_by` varchar(255) NOT NULL,
|
||||||
|
`date` datetime DEFAULT NULL,
|
||||||
`created_at` timestamp NULL DEFAULT NULL,
|
`created_at` timestamp NULL DEFAULT NULL,
|
||||||
`updated_at` timestamp NULL DEFAULT NULL,
|
`updated_at` timestamp NULL DEFAULT NULL,
|
||||||
`deleted_at` timestamp NULL DEFAULT NULL
|
`deleted_at` timestamp NULL DEFAULT NULL
|
||||||
@ -232,9 +234,9 @@ CREATE TABLE `events` (
|
|||||||
-- Dumping data for table `events`
|
-- Dumping data for table `events`
|
||||||
--
|
--
|
||||||
|
|
||||||
INSERT INTO `events` (`id`, `title`, `description`, `location`, `hosted_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
|
INSERT INTO `events` (`id`, `title`, `description`, `image`, `location`, `hosted_by`, `date`, `created_at`, `updated_at`, `deleted_at`) VALUES
|
||||||
(1, 'Event 1', 'Description for Event 1.', 'Location 1', 'Host 1', '2024-01-03 07:39:47', '2024-01-03 07:39:47', NULL),
|
(1, 'Event 1', 'Description for Event 1.', '1.jpg', 'Location 1', 'Host 1', NULL, '2024-01-03 07:39:47', '2024-01-03 07:39:47', NULL),
|
||||||
(2, 'Event 2', 'Description for Event 2.', 'Location 2', 'Host 2', '2024-01-03 07:39:47', '2024-01-03 07:39:47', NULL);
|
(2, 'Event 2', 'Description for Event 2.', '02.jpg', 'Location 2', 'Host 2', NULL, '2024-01-03 07:39:47', '2024-01-03 07:39:47', NULL);
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
BIN
public/uploads/event/02.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 69 KiB |
BIN
public/uploads/event/03.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 79 KiB |
BIN
public/uploads/event/1.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 69 KiB |
BIN
public/uploads/event/10.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 83 KiB |
BIN
public/uploads/event/2.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 94 KiB |
BIN
public/uploads/event/3.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 100 KiB |
BIN
public/uploads/event/4.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 81 KiB |
BIN
public/uploads/event/5.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 138 KiB |
BIN
public/uploads/event/6.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 87 KiB |
BIN
public/uploads/event/7.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 40 KiB |
BIN
public/uploads/event/8.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 108 KiB |
BIN
public/uploads/event/9.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 101 KiB |
BIN
public/uploads/event/dots.png
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 390 B |
BIN
public/uploads/event/image01.png
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 83 KiB |
BIN
public/uploads/event/image02.png
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 71 KiB |
BIN
public/uploads/event/info.jpg
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 234 KiB |
BIN
public/uploads/event/round.png
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 2.0 KiB |
BIN
public/uploads/event/speaker01.png
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 56 KiB |
BIN
public/uploads/event/speaker02.png
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 52 KiB |
BIN
public/uploads/event/speaker03.png
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 41 KiB |
BIN
public/uploads/event/speaker04.png
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 44 KiB |
BIN
public/uploads/event/speaker05.png
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 55 KiB |
BIN
public/uploads/event/speaker06.png
Fichier normal
|
Après Largeur: | Hauteur: | Taille: 37 KiB |