blog-update

et#14
Mahesh Sharma 2 years ago
parent c3ba2dd657
commit 3f29aac604
  1. 26
      app/Http/Controllers/Admin/ImageUploadController.php
  2. 2
      app/Http/Controllers/Admin/NewsAndUpdateController.php
  3. 6
      app/Http/Controllers/HomeController.php
  4. 26
      app/Http/Controllers/ImageUploadController.php
  5. 2
      app/Models/NewsAndUpdate.php
  6. BIN
      public/7ac0b60cb566e5c9b6d6fb20999ca967.png
  7. BIN
      public/e497bb5460bd22aca71646ce179918ec.png
  8. BIN
      public/images/media/1674659654211_1675317628.jpeg
  9. BIN
      public/images/media/smiling-girls_1675317552.png
  10. BIN
      public/images/media/smiling-girls_1675320663.png
  11. BIN
      public/images/news_and_update/2023/02/02/13077aec220e4818c3beb064ad406b54.png
  12. BIN
      public/images/news_and_update/2023/02/02/2ce5d9d94acea4e17e6bb6e5bbe45a64.jpeg
  13. BIN
      public/images/news_and_update/2023/02/02/4181cd37c804e421d09d62c4061c9217.png
  14. BIN
      public/images/news_and_update/2023/02/02/630a12c884ad69f4dc3954d222143dd6.png
  15. 24
      resources/views/admin/news_and_update/create.blade.php
  16. 11
      resources/views/admin/news_and_update/edit.blade.php
  17. 15
      resources/views/admin/service_section/edit.blade.php
  18. 2
      resources/views/blogs.blade.php
  19. 1
      resources/views/welcome.blade.php
  20. 1
      routes/web.php

@ -0,0 +1,26 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ImageUploadController extends Controller
{
public function storeImage(Request $request)
{
if ($request->hasFile('upload')) {
$finfo = finfo_open(FILEINFO_MIME_TYPE); // Return MIME type a la the 'mimetype' extension
$mimeType = finfo_file($finfo, $request->file('upload'));
finfo_close($finfo);
if ($mimeType == 'image/jpeg' || $mimeType == 'image/png' || $mimeType == 'image/svg+xml' || $mimeType == 'image/gif' || $mimeType == 'image/webp') {
$originName = $request->file('upload')->getClientOriginalName();
$fileName = pathinfo($originName, PATHINFO_FILENAME);
$extension = $request->file('upload')->getClientOriginalExtension();
$fileName = $fileName . '_' . time() . '.' . $extension;
$request->file('upload')->move(public_path('images/media'), $fileName);
$url = asset('images/media/' . $fileName);
return response()->json(['fileName' => $fileName, 'uploaded'=> 1, 'url' => $url]);
}
}
}
}

@ -43,7 +43,6 @@ class NewsAndUpdateController extends Controller
public function store(Request $request) public function store(Request $request)
{ {
$this->validate(\request(), [ $this->validate(\request(), [
'description' => 'required', 'description' => 'required',
// 'bottom_description' => 'required', // 'bottom_description' => 'required',
@ -105,7 +104,6 @@ class NewsAndUpdateController extends Controller
} }
public function update(Request $request, $id){ public function update(Request $request, $id){
$setting =NewsAndUpdate::findorfail($id); $setting =NewsAndUpdate::findorfail($id);
$this->validate(\request(), [ $this->validate(\request(), [
'description' => 'required', 'description' => 'required',

@ -7,6 +7,7 @@ use App\Models\Slider;
use App\Models\Testimonial; use App\Models\Testimonial;
use App\Models\NewsAndUpdate; use App\Models\NewsAndUpdate;
use App\Models\Subscription; use App\Models\Subscription;
use App\Models\AboutUs;
class HomeController extends Controller class HomeController extends Controller
{ {
@ -14,7 +15,8 @@ class HomeController extends Controller
$sliders = Slider::where('status',1)->get(); $sliders = Slider::where('status',1)->get();
$testimonials = Testimonial::where('status',1)->get(); $testimonials = Testimonial::where('status',1)->get();
$blogs = NewsAndUpdate::where('status',1)->get(); $blogs = NewsAndUpdate::where('status',1)->get();
return view('welcome',compact('sliders','testimonials','blogs')); $about_us = AboutUs::where('status',1)->get();
return view('welcome',compact('sliders','testimonials','blogs','about_us'));
} }
public function subscribe(Request $request) public function subscribe(Request $request)
{ {
@ -36,7 +38,7 @@ class HomeController extends Controller
), function($message) use ($request){ ), function($message) use ($request){
$subject = 'Subscription Notice'; $subject = 'Subscription Notice';
$message->subject('Subscription Notice'); $message->subject('Subscription Notice');
$message->to('admin@eteducation.com.au', 'Et-Visa')->subject($subject); $message->to('admin@eteducation.com.au', 'Et-Visa')->subject($subject);
$message->cc('extratechweb@gmail.com', 'Extratech')->subject($subject); $message->cc('extratechweb@gmail.com', 'Extratech')->subject($subject);
$message->cc('suman@extratechs.com.au', 'Extratech')->subject($subject); $message->cc('suman@extratechs.com.au', 'Extratech')->subject($subject);

@ -0,0 +1,26 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ImageUploadController extends Controller
{
public function storeImage(Request $request)
{
if ($request->hasFile('upload')) {
$finfo = finfo_open(FILEINFO_MIME_TYPE); // Return MIME type a la the 'mimetype' extension
$mimeType = finfo_file($finfo, $request->file('upload'));
finfo_close($finfo);
if ($mimeType == 'image/jpeg' || $mimeType == 'image/png' || $mimeType == 'image/svg+xml' || $mimeType == 'image/gif' || $mimeType == 'image/webp') {
$originName = $request->file('upload')->getClientOriginalName();
$fileName = pathinfo($originName, PATHINFO_FILENAME);
$extension = $request->file('upload')->getClientOriginalExtension();
$fileName = $fileName . '_' . time() . '.' . $extension;
$request->file('upload')->move(public_path('images/media'), $fileName);
$url = asset('images/media/' . $fileName);
return response()->json(['fileName' => $fileName, 'uploaded'=> 1, 'url' => $url]);
}
}
}
}

@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Model;
class NewsAndUpdate extends Model class NewsAndUpdate extends Model
{ {
use HasFactory; use HasFactory;
protected $fillable=['slug','point_title','blog_type','image','image_alt','description','seo_title','seo_description','middle_description','bottom_description','keyword','meta_keyword','status','publish_date','title','image_credit','author','image_caption','thumbnail']; protected $fillable=['slug','type','point_title','blog_type','image','image_alt','description','seo_title','seo_description','middle_description','bottom_description','keyword','meta_keyword','status','publish_date','title','image_credit','author','image_caption','thumbnail'];
public function news_and_update_points() public function news_and_update_points()
{ {

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 KiB

@ -53,6 +53,17 @@
<input type="file" class="form-control" name="thumbnail" required> <input type="file" class="form-control" name="thumbnail" required>
</div> </div>
</div> </div>
<div class="col-md-4">
<div class="form-group">
<label>Related To <span style="color: red";> * </span> </label>
<select name="type" class="form-control" id="type" required>
<option value="" selected disabled>Please select service type</option>
<option value="1" {{(old('type')== 1) ? 'selected':''}}>Education</option>
<option value="2" {{(old('type')== 2) ? 'selected':''}}>Visa</option>
</select>
</div>
</div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label> Image Caption </label> <label> Image Caption </label>
@ -133,18 +144,7 @@
</div> </div>
</div> </div>
<!-- <div class="col-md-4">
<div class="form-group">
<label>Type <span style="color: red";> * </span> </label>
<select name="blog_type" class="form-control" id="blog_type" required>
<option value="" selected disabled>Please select Type</option>
@foreach(config('custom.blog_types') as $index => $value)
<option value="{{$index}}" {{(old('blog_type')==$index) ? 'selected':''}}>{{$value}}</option>
@endforeach
</select>
</div>
</div> -->
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label>Type <span style="color: red";> * </span> </label> <label>Type <span style="color: red";> * </span> </label>

@ -66,6 +66,17 @@
</span> </span>
</div> </div>
</div> </div>
<div class="col-md-4">
<div class="form-group">
<label>Related To <span style="color: red";> * </span> </label>
<select name="type" class="form-control" id="type" required>
<option value="" selected disabled>Please select service type</option>
<option value="1" {{($setting->type == 1) ? 'selected':''}}>Education</option>
<option value="2" {{($setting->type== 2) ? 'selected':''}}>Visa</option>
</select>
</div>
</div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label> Image Caption </label> <label> Image Caption </label>

@ -109,8 +109,19 @@
@endsection @endsection
@section('script') @section('script')
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('.summernote_class').summernote() $('.summernote_class').summernote({
colors: [
['#000000', '#424242', '#636363', '#9C9C94', '#CEC6CE', '#EFEFEF', '#F7F7F7', '#FFFFFF'],
['#FF0000', '#FF9C00', '#FFFF00', '#00FF00', '#00FFFF', '#0000FF', '#9C00FF', '#FF00FF'],
['#F7C6CE', '#FFE7CE', '#FFEFC6', '#D6EFD6', '#CEDEE7', '#CEE7F7', '#D6D6E7', '#E7D6DE'],
['#E79C9C', '#FFC69C', '#FFE79C', '#B5D6A5', '#A5C6CE', '#9CC6EF', '#B5A5D6', '#D6A5BD'],
['#E76363', '#F7AD6B', '#FFD663', '#94BD7B', '#73A5AD', '#6BADDE', '#8C7BC6', '#C67BA5'],
['#CE0000', '#E79439', '#EFC631', '#6BA54A', '#4A7B8C', '#3984C6', '#634AA5', '#A54A7B'],
['#9C0000', '#B56308', '#BD9400', '#397B21', '#104A5A', '#085294', '#311873', '#731842'],
['#630000', '#7B3900', '#846300', '#295218', '#083139', '#003163', '#21104A', '#4A1031']
],
})
}) })
// ClassicEditor // ClassicEditor
// .create( document.querySelector( '#body' ), // .create( document.querySelector( '#body' ),

@ -54,7 +54,7 @@
<h6>{{$blog->publish_date}}</h6> <h6>{{$blog->publish_date}}</h6>
<h2>{{$blog->title}} </h2> <h2>{{$blog->title}} </h2>
<p>{!!(\Illuminate\Support\Str::limit($blog->description, 200, $end='...'))!!}</p> <p>{!!(\Illuminate\Support\Str::limit($blog->description, 200, $end='...'))!!}</p>
<a href="blog-detail">Read More <i class="fa-solid fa-arrow-right-long ms-2 fa-xs"></i></a> <a href="{{url('/blog/'.$blog->slug)}}">Read More <i class="fa-solid fa-arrow-right-long ms-2 fa-xs"></i></a>
</div> </div>
</div> </div>
@endforeach @endforeach

@ -169,6 +169,7 @@
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<div class="why-us-desc"> <div class="why-us-desc">
<!-- {!!$about_us->skip(1)->first()->description!!} -->
<h1>Why Choose Us</h1> <h1>Why Choose Us</h1>
<p>a remarkable number of Nepalese students from across the world, from diverse backgrounds, have achieved their international education goals successfully through us, the best Study Abroad Consultants in Nepal.</p> <p>a remarkable number of Nepalese students from across the world, from diverse backgrounds, have achieved their international education goals successfully through us, the best Study Abroad Consultants in Nepal.</p>
<div class="why-us-lists"> <div class="why-us-lists">

@ -24,6 +24,7 @@ use App\Http\Controllers\Admin\HomeController as HomeAdminController;
use App\Http\Controllers\Admin\SliderController; use App\Http\Controllers\Admin\SliderController;
use App\Http\Controllers\Admin\PartnerController; use App\Http\Controllers\Admin\PartnerController;
use App\Http\Controllers\NewsController; use App\Http\Controllers\NewsController;
use App\Http\Controllers\ImageUploadController;
use App\Http\Controllers\Admin\NewsAndUpdateController; use App\Http\Controllers\Admin\NewsAndUpdateController;
use App\Http\Controllers\Admin\SubOfficeController; use App\Http\Controllers\Admin\SubOfficeController;
use App\Http\Controllers\Admin\DepartmentController; use App\Http\Controllers\Admin\DepartmentController;

Loading…
Cancel
Save