Skip to content

Commit

Permalink
Verify account complete.
Browse files Browse the repository at this point in the history
  • Loading branch information
subhadipghorui committed Jan 22, 2021
1 parent faaa09b commit f85b0db
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 106 deletions.
2 changes: 2 additions & 0 deletions app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use App\User;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Date;
use Laravel\Socialite\Facades\Socialite;
use Illuminate\Support\Str;

Expand Down Expand Up @@ -70,6 +71,7 @@ public function handleProviderCallback()
$newUser = new User();
$newUser->email = $user->email;
$newUser->name = $user->name;
$newUser->email_verified_at = Date::now();
$newUser->userid = $user->id;
$newUser->password = uniqid().Str::random(10); // we dont need password for login. For random number we user Str::random()
$newUser->save();
Expand Down
2 changes: 1 addition & 1 deletion app/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

class User extends Authenticatable
class User extends Authenticatable implements MustVerifyEmail
{
use Notifiable;

Expand Down
Binary file added public/frontend/img/google.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

</div>
<div class="row d-flex justify-content-center space-between">
<a href="{{url('/login/google')}}" class="btn btn-outline-info m-2">Sing in with Google <i class="fab fa-google-plus" style="color: rgb(185, 57, 11);"></i></a><span class="text-dark font-weight-bold mt-3">
<a href="{{url('/login/google')}}" class="btn btn-outline-info m-2">Sing in with Google <img src="{{asset('frontend/img/google.jpg')}}" alt="google" width="40px"></a><span class="text-dark font-weight-bold mt-3">

</div>

Expand Down
2 changes: 1 addition & 1 deletion resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
<div class="container">
<a class="navbar-brand" href="{{ url('/') }}">
{{ config('app.name', 'Laravel') }}
<img src="{{asset('frontend/img/sitelogo.png')}}" alt="logo" width="100px">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
<span class="navbar-toggler-icon"></span>
Expand Down
16 changes: 8 additions & 8 deletions resources/views/layouts/frontend/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ class="form-inline"
<div class="single-footer-widget mail-chimp">
<h6 class="mb-20">Instragram Feed</h6>
<ul class="instafeed d-flex flex-wrap">
<li><img src="img/i1.jpg" alt="" /></li>
<li><img src="img/i2.jpg" alt="" /></li>
<li><img src="img/i3.jpg" alt="" /></li>
<li><img src="img/i4.jpg" alt="" /></li>
<li><img src="img/i5.jpg" alt="" /></li>
<li><img src="img/i6.jpg" alt="" /></li>
<li><img src="img/i7.jpg" alt="" /></li>
<li><img src="img/i8.jpg" alt="" /></li>
<li><img src="{{asset('frontend/img/i1.jpg')}}" alt="" /></li>
<li><img src="{{asset('frontend/img/i2.jpg')}}" alt="" /></li>
<li><img src="{{asset('frontend/img/i3.jpg')}}" alt="" /></li>
<li><img src="{{asset('frontend/img/i4.jpg')}}" alt="" /></li>
<li><img src="{{asset('frontend/img/i5.jpg')}}" alt="" /></li>
<li><img src="{{asset('frontend/img/i6.jpg')}}" alt="" /></li>
<li><img src="{{asset('frontend/img/i7.jpg')}}" alt="" /></li>
<li><img src="{{asset('frontend/img/i8.jpg')}}" alt="" /></li>
</ul>
</div>
</div>
Expand Down
188 changes: 101 additions & 87 deletions resources/views/mail/newpost.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,102 +5,116 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>New Post Available</title>
<link
href="https://fonts.googleapis.com/css?family=Poppins:100,200,400,300,500,600,700"
rel="stylesheet"/>
<!--
CSS
============================================= -->
<link rel="stylesheet" href="{{asset('frontend/css/linearicons.css')}}" />
<link rel="stylesheet" href="{{asset('frontend/css/font-awesome.min.css')}}" />
<link rel="stylesheet" href="{{asset('frontend/css/bootstrap.css')}}" />
<link rel="stylesheet" href="{{asset('frontend/css/owl.carousel.css')}}" />
<link rel="stylesheet" href="{{asset('frontend/css/main.css')}}" />
<style>
.heading{
width: 100%;
/* background: rgb(245, 245, 245); */
display: flex;
justify-content: center;
padding: 20px 0;
margin-bottom: 1rem;
}
.mail-footer{
width: 100%;
background: rgb(6, 101, 156);
color: #fff;
padding: 20px 10px;
}
.mail-footer a{
color: #fff;
}
.mail-footer a:hover{
color: rgb(5, 247, 255);
}
</style>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.container{
max-width: 540px;
height: auto;
margin: auto;
/* border: 1px solid #333; */
display: flex;
flex-direction: column;
}
.navbar{
max-width: 540px;
display: flex;
justify-content: center;
padding: 10px 0px;
}
.navbar img{
width: 100px;
height: auto;
margin: auto;
}
.post{
padding: 0 15px;
}
.post img{
position: relative;
width: 100%;
margin-bottom: 10px
}
.post .post-info{
margin-top: 10px;
margin-bottom: 10px;
display: flex;
justify-content: space-between;
}
.post .post-info h2{
color: rgb(30, 165, 255);
}
.post-info .author {
display: flex;
}
.post-info .author p{
font-size: 16px;
color: rgb(189, 189, 189)
}
.post-info .author .author-img img{
width: 50px;
}
.post .post-body{
margin-bottom: 20px;
}
.btn{
color: #ffff;
background: rgb(26, 144, 255);
outline: none;
padding: 10px 20px;
text-decoration: none;
border-radius: 70px;
}
.btn:hover{
background: rgb(19, 113, 202);
}
.footer{
width: 100%;
height: 70px;
background: rgb(48, 48, 48);
margin-top: 30px;
padding: 10px 8px;
}
.footer p{
color: #ffff;
font-size: 16px;
line-height: 1.5;
}
</style>
</head>
<body>
<div class="container">
<div class="row justify-content-center">
<div class="col-6 heading">
<img src="http://localhost:8000/frontend/img/sitelogo.png" alt="logo" width="100px">
{{-- <h1>myiotlab</h1> --}}
</div>
<div class="navbar">
<img src="{{url('frontend/img/sitelogo.png')}}" alt="logo" />
</div>
<div class="row justify-content-center">
<div class="single-posts col-lg-6 col-sm-6">
<img class="img-fluid" src="{{asset('storage/post/'.$post->image)}}" alt="">
<div class="date mt-20 mb-20">{{$post->created_at->diffForHumans()}}</div>
<div class="detail">
<a href="{{route('post', $post->slug)}}"><h3 class="pb-20">{{$post->title}}</h3></a>
<div class="row d-flex">
<h4 class="ml-3">{{$post->category->name}}</h4>
<div class="col-lg-4 col-md-12 right-side d-flex justify-content-end ml-auto">
<div class="desc">
<h4>{{$post->user->name}}</h4>
</div>
<div class="container">
<div class="post">
<img src="{{asset('storage/post/'.$post->image)}}" alt="post">
<h2>Lorem ipsum dolor sit amet consectetur adipisicing elit. Nihil, similique.</h2>
<div class="post-info">
<h2>{{$post->category->name}}</h2>
<div class="author">
<div class="author-name">
<h3>{{$post->user->name}}</h3>
<p>{{$post->created_at->diffForHumans()}}</p>
</div>
<div class="user-img">
<img src="{{asset('storage/user/'.$post->user->image)}}" alt="" width="50px"/>
</div>
</div>
</div>
<p>
{!!Str::limit($post->body, 300)!!}
</p>
<p class="footer pt-20">
<i class="fa fa-heart-o" aria-hidden="true"></i>
<a href="#">{{$post->likedUsers->count()}} Likes</a> <i class="ml-20 fa fa-comment-o" aria-hidden="true"></i> <a href="#">{{$post->comments->count()}} Comments</a>
</p>
</div>
<div class="author-img">
<img src="{{asset('storage/user/'.$post->user->image)}}" alt="" width="50px" height='auto'>
</div>
</div>
<div class="justify-content-center d-flex">
<a class="text-uppercase primary-btn loadmore-btn mt-70 mb-60" href="{{route('post', $post->slug)}}">Read more</a>
</div>
</div>

<p class="post-body">{!!Str::limit($post->body, 400)!!}</p>
<a href="{{route('post',$post->slug)}}" class="btn">Read More</a>
</div>
<div class="row justify-content-center">
<div class="col-6 mail-footer">
<p>This email is from <a href="https://myiotlab.in">myiotlab.in</a></p>
<p>© 2020 myiotlab. All Rights Reserved</p>
</div>
<div class="footer">
<p>This mail is from myiotlab.in.</p>
<p>© <script>let t = new Date(); document.write(t.getFullYear());</script> myiotlab. All rights reserved.</p>
</div>
</div>

{{-- JS --}}
<script src="{{asset('frontend/js/vendor/jquery-2.2.4.min.js')}}"></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"
integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4"
crossorigin="anonymous"
></script>
<script src="{{asset('frontend/js/vendor/bootstrap.min.js')}}"></script>
<script src="{{asset('frontend/js/jquery.ajaxchimp.min.js')}}"></script>
<script src="{{asset('frontend/js/parallax.min.js')}}"></script>
<script src="{{asset('frontend/js/owl.carousel.min.js')}}"></script>
<script src="{{asset('frontend/js/jquery.magnific-popup.min.js')}}"></script>
<script src="{{asset('frontend/js/jquery.sticky.js')}}"></script>
<script src="{{asset('frontend/js/main.js')}}"></script>
</body>
</html>
15 changes: 7 additions & 8 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// return view('welcome');
// });

Auth::routes();
Auth::routes(['verify' => true]);

// Social Login
Route::get('login/google', 'Auth\LoginController@redirectToProvider');
Expand All @@ -39,13 +39,13 @@
Route::get('/category/{slug}', 'HomeController@categoryPost')->name('category.post');
Route::get('/search', 'HomeController@search')->name('search');
Route::get('/tag/{name}', 'HomeController@tagPosts')->name('tag.posts');
Route::post('/comment/{post}', 'CommentController@store')->name('comment.store')->middleware('auth');
Route::post('/comment-reply/{comment}', 'CommentReplyController@store')->name('reply.store')->middleware('auth');
Route::post('/like-post/{post}', 'HomeController@likePost')->name('post.like')->middleware('auth');
Route::post('/comment/{post}', 'CommentController@store')->name('comment.store')->middleware(['auth', 'verified']);
Route::post('/comment-reply/{comment}', 'CommentReplyController@store')->name('reply.store')->middleware(['auth', 'verified']);
Route::post('/like-post/{post}', 'HomeController@likePost')->name('post.like')->middleware(['auth', 'verified']);


// Admin ////////////////////////////////////////////////////////////////////////
Route::group(['prefix' => 'admin', 'as' => 'admin.', 'namespace' => 'Admin', 'middleware' => ['auth', 'admin']], function () {
Route::group(['prefix' => 'admin', 'as' => 'admin.', 'namespace' => 'Admin', 'middleware' => ['auth', 'admin','verified']], function () {
Route::get('dashboard', 'DashboardController@index')->name('dashboard');
Route::get('profile', 'DashboardController@showProfile')->name('profile');
Route::put('profile', 'DashboardController@updateProfile')->name('profile.update');
Expand All @@ -62,8 +62,8 @@
});

// User ////////////////////////////////////////////////////////////////////////
Route::group(['prefix' => 'user', 'as' => 'user.', 'namespace' => 'User', 'middleware' => ['auth', 'user']], function () {
Route::get('dashboard', 'DashboardController@index')->name('dashboard');
Route::group(['prefix' => 'user', 'as' => 'user.', 'namespace' => 'User', 'middleware' => ['auth', 'user', 'verified']], function () {
Route::get('dashboard', 'DashboardController@likedPosts')->name('dashboard');
Route::get('profile', 'DashboardController@showProfile')->name('profile');
Route::put('profile', 'DashboardController@updateProfile')->name('profile.update');
Route::put('profile/password', 'DashboardController@changePassword')->name('profile.password');
Expand All @@ -89,7 +89,6 @@
$post = Post::findOrFail(7);
// Send Mail
Mail::to('user@user.com')
->bcc(['user1@user.com','user2@user.com'])
->queue(new NewPost($post));

return (new App\Mail\NewPost($post))->render();
Expand Down

0 comments on commit f85b0db

Please sign in to comment.