Skip to content

Commit

Permalink
UPDATE! fixed many things and added compability to iphone mini and fo…
Browse files Browse the repository at this point in the history
…r any phones whose width: 320px,360px,400px,450px, database stored email update
  • Loading branch information
Lostky01 committed Sep 4, 2023
1 parent 72e0218 commit e50e572
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/Http/Controllers/EmailController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail;
use App\Mail\SendEmail;
use App\Models\Data;

class EmailController extends Controller
{
Expand All @@ -24,6 +25,8 @@ public function sendEmail(Request $request)

Mail::to('[email protected]')->send(new SendEmail($data));

Data::create($data);

return redirect()->back()->with('message', 'Email sent successfully!');
}
}
17 changes: 17 additions & 0 deletions app/Models/Data.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Data extends Model
{
use HasFactory;

protected $table = 'dataemail';
protected $fillable = [
'name','email','phone','message'
];

}
70 changes: 70 additions & 0 deletions dataemail.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
-- phpMyAdmin SQL Dump
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 04, 2023 at 06:13 AM
-- Server version: 10.4.27-MariaDB
-- PHP Version: 8.2.0

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `email_data`
--

-- --------------------------------------------------------

--
-- Table structure for table `dataemail`
--

CREATE TABLE `dataemail` (
`id` int(11) NOT NULL,
`name` varchar(98) DEFAULT NULL,
`email` varchar(98) DEFAULT NULL,
`phone` varchar(98) DEFAULT NULL,
`message` mediumtext DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `dataemail`
--

INSERT INTO `dataemail` (`id`, `name`, `email`, `phone`, `message`, `created_at`, `updated_at`) VALUES
(1, 'Rifky', '[email protected]', '081385217033', 'halloofaofoafa kamu lagi apa', '2023-09-03 21:12:09', '2023-09-03 21:12:09');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `dataemail`
--
ALTER TABLE `dataemail`
ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `dataemail`
--
ALTER TABLE `dataemail`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
3 changes: 2 additions & 1 deletion resources/views/contactus.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@
<button type="submit" class="btn btn-primary"
style="background-color: #000000; border-radius: 0 !important;">Submit</button>
</div>
</form>
<input type="hidden" name="send_email" value="1">
</form>
</div>
</div>
</div>
Expand Down

0 comments on commit e50e572

Please sign in to comment.