Duzedishler

This commit is contained in:
ilmedova 2020-02-24 17:34:07 +05:00
parent 490364939e
commit 61e2b6ac3c
8 changed files with 114 additions and 14 deletions

View File

@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Mail;
use App\Mail\SendMail; use App\Mail\SendMail;
use App\User;
@ -34,4 +35,29 @@ class ContactController extends Controller
return back()->with('success', 'Hatyňyz Üstünlikli ugradyldy.'); return back()->with('success', 'Hatyňyz Üstünlikli ugradyldy.');
} }
public function sendMail(Request $request){
$user = User::find($request->id);
$id = $request->id;
return view('mail.compose',[
'id' => $id,
'user' => $user
]);
}
public function postMail(Request $request){
try{
$data = array(
'name' => 'Turkmen TV',
'email' => 'mahabatmudirligi@gmail.com',
'subject' => $request->subject,
'message' => $request->message
);
Mail::to($request->email)->send(new SendMail($data));
return redirect('/panel/user');
}catch(\Swift_TransportException $e){
$response = $e->getMessage();
return $response;
}
}
} }

View File

@ -44,4 +44,11 @@ class User extends Authenticatable
public function likes(){ public function likes(){
return $this->hasMany(UserMaterial::class); return $this->hasMany(UserMaterial::class);
} }
public function sendMail($crud = false)
{
//$address = route('sendMail',$this->id);
return "<a class='btn btn-xs btn-default' href='/sendMail/".$this->id."'
data-toggle='tooltip' title='Ullanyja mail ibermek'><i class='fa fa-send'></i> Mail</a>";
}
} }

View File

@ -16,7 +16,7 @@ return [
| |
*/ */
'driver' => env('MAIL_DRIVER', 'smtp'), 'driver' => env('MAIL_DRIVER', 'mail'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -29,7 +29,7 @@ return [
| |
*/ */
'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 'host' => env('MAIL_HOST', 'smtp.gmail.com'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@ -0,0 +1,66 @@
@extends('backpack::layout')
@section('header')
<section class="content-header">
<h1>
<span class="text-capitalize">Send mail</span>
</h1>
<ol class="breadcrumb">
<li><a href="/panel/dashboard">Admin</a></li>
<li><a href="/panel/user" class="text-capitalize">Users</a></li>
<li class="active">Send mail</li>
</ol>
</section>
@endsection
@section('content')
<a href="/panel/user" class="hidden-print"><i class="fa fa-angle-double-left"></i> Back to all <span>Users</span></a>
<div class="row m-t-20">
<div class="col-md-8 col-md-offset-2">
<!-- Default box -->
<form method="post" action="/postMail" enctype="multipart/form-data">
@csrf
<div class="col-md-12">
<div class="row display-flex-wrap">
<!-- load the view from the application if it exists, otherwise load the one in the package -->
<input type="hidden" name="back_url" value='/panel/users'>
<input type="hidden" name="email" value="{{$user->email}}" class="form-control">
<input type="hidden" name="id" value="{{$id}}" class="form-control">
<div class="tab-content panel col-md-8 m-t-10">
<div role="tabpanel" class="tab-pane active">
<!-- load the view from type and view_namespace attribute if set -->
<!-- load the view from type and view_namespace attribute if set -->
<!-- text input -->
<div class="form-group col-xs-12">
<label>Subject</label>
<input name="subject" class="form-control">
</div>
<!-- text input -->
<div class="form-group col-xs-12">
<label>Message text here</label>
<textarea name="message" class="form-control summernote">
</textarea>
</div>
<!-- load the view from type and view_namespace attribute if set -->
</div>
</div>
</div><!-- /.box-body -->
<div class="">
<div id="saveActions" class="form-group">
<input type="hidden" name="save_action" value="save_and_back">
<div class="btn-group">
<button type="submit" class="btn btn-success">
<span class="fa fa-send" role="presentation" aria-hidden="true"></span> &nbsp;
<span data-value="save_and_back">Send and back</span>
</button>
</div>
<a href="/panel/user" class="btn btn-default"><span class="fa fa-ban"></span> &nbsp;Cancel</a>
</div>
</div><!-- /.box-footer-->
</div><!-- /.box -->
</form>
</div>
</div>
@endsection

View File

@ -32,7 +32,6 @@
<li class="active"><span class='fontRegular'>{{$page->title}}</span></li> <li class="active"><span class='fontRegular'>{{$page->title}}</span></li>
</ol> </ol>
</div> </div>
<div class="container mahabat"> <div class="container mahabat">
<div class="row"> <div class="row">
<div class="tpl-block-list tpl-component-bestadv tpl-template-212" id="nc-block-65830ee3ad0cadee448c685324b10d4a"> <div class="tpl-block-list tpl-component-bestadv tpl-template-212" id="nc-block-65830ee3ad0cadee448c685324b10d4a">
@ -72,7 +71,7 @@
@endforeach @endforeach
</div> </div>
@if(!empty($shows)) @if(!empty($shows))
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style=" text-align: center;"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="text-align: center;">
{{ $shows->links('vendor.pagination.simple-default') }} {{ $shows->links('vendor.pagination.simple-default') }}
</div> </div>
@endif @endif

View File

@ -184,8 +184,8 @@ setInterval(function () {document.getElementById("nextq").click();}, 4500);
pagination: false, pagination: false,
navigation : true, // Show next and prev buttons navigation : true, // Show next and prev buttons
slideSpeed : 300, slideSpeed : 3,
paginationSpeed : 400, paginationSpeed : 3,
singleItem:true, singleItem:true,
autoPlay: true, autoPlay: true,
stopOnHover: true, stopOnHover: true,
@ -222,7 +222,7 @@ setInterval(function () {document.getElementById("nextq").click();}, 4500);
[1400, 13], [1400, 13],
[1600, 15] [1600, 15]
], ],
navigation : false, navigation : true,
pagination : false, pagination : false,
}); });

View File

@ -16,11 +16,11 @@
<div id="owl-demo" class="owl-carousel owl-theme"> <div id="owl-demo" class="owl-carousel owl-theme">
@foreach($sliders as $slider) @foreach($sliders as $slider)
<a href = "{{$slider -> url}}"> <a href="{{$slider->url}}">
<div class="item"> <div class="item">
<img src="{{ $slider -> img_url }}" alt="{{ $slider->alt }}"> <img src="{{ $slider ->img_url}}" alt="{{ $slider->alt }}">
<div class="carousel-caption" style = "left: 25%;"> <div class="carousel-caption" style = "left: 25%;">
<p style = "font-family:SourceSansBold;width: 80%;left: 59%;text-align: center;font-size: 37px;">{{$slider -> text}}</p> <p style = "font-family:SourceSansBold;width: 80%;left: 59%;text-align: center;font-size: 37px;">{{$slider->text}}</p>
</div> </div>
</div> </div>
</a> </a>
@ -200,15 +200,14 @@
</div> </div>
@endforeach @endforeach
@endif @endif
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-3"> <div class="col-lg-4 col-md-4 col-sm-3">
<div class="tpl-block-list tpl-component-reklama" id="nc-block-973f127d297ece8152574c74d10a8f15"> <div class="tpl-block-list tpl-component-reklama" id="nc-block-973f127d297ece8152574c74d10a8f15">
<a href="{{$advertMiddle->url}}"> <a href="{{$advertMiddle->url}}">
<img src="{{$advertMiddle->img_url}}" alt="{{$advertMiddle->alt}}" style="width: 100%"> <img src="{{$advertMiddle->img_url}}" alt="{{$advertMiddle->alt}}" style="width: 100%">
</a> </a>
</div> </div> </div>
</div>
</div> </div>
</div> </div>
</div></div><div class="tpl-block-list tpl-component-mostpopulm" id="nc-block-dc1fe9b45accfd1b34aa36b11faceb16"><div id="mostpopulm"></div> </div></div><div class="tpl-block-list tpl-component-mostpopulm" id="nc-block-dc1fe9b45accfd1b34aa36b11faceb16"><div id="mostpopulm"></div>

View File

@ -32,6 +32,9 @@ Route::get('/film/{id}', 'MenuLinkController@getFilm')->name('getFilm');
Route::get('/habarlashyk', 'ContactController@habarlashyk')->name('cont'); Route::get('/habarlashyk', 'ContactController@habarlashyk')->name('cont');
Route::post('/contact/send', 'ContactController@send')->name('send'); Route::post('/contact/send', 'ContactController@send')->name('send');
Route::get('/sendMail/{id}', 'ContactController@sendMail');
Route::post('/postMail/', 'ContactController@postMail');
// ** ------- WEB -------- ** // // ** ------- WEB -------- ** //