Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. <div class="col-md-8 col-md-offset-2">
  2.  
  3. @if (count($errors) > 0)
  4. <div class="alert alert-danger">
  5. <strong>Whoops!</strong> There were some problems with your input.<br><br>
  6. <ul>
  7. @foreach ($errors->all() as $error)
  8. <li>{{ $error }}</li>
  9. @endforeach
  10. </ul>
  11. </div>
  12. @endif
  13.  
  14. @if ($message = Session::get('success'))
  15. <div class="alert alert-success alert-block">
  16. <button type="button" class="close" data-dismiss="alert">×</button>
  17. <strong>{{ $message }}</strong>
  18. </div>
  19. <img src="/images/{{ Session::get('path') }}">
  20. @endif
  21.  
  22.  
  23. <div class="box box-info">
  24. <div class="box-header with-border text-center">
  25. <h3 class="box-title">Basic Info</h3>
  26. </div>
  27. <!-- /.box-header -->
  28. <!-- form start -->
  29. <form class="form-horizontal" action="{{ url('/') }}/admin/change-site-logo" enctype="multipart/form-data" method="POST">
  30. <div class="box-body">
  31. {{ csrf_field() }}
  32. <div class="form-group">
  33. <label for="logo" class="col-sm-3 control-label">Logo</label>
  34.  
  35. <div class="col-sm-9">
  36. <input type="file" class="form-control" id="logo" name="logo" placeholder="Logo Image">
  37. </div>
  38.  
  39. </div>
  40.  
  41. <div class="form-group">
  42. <label for="logo" class="col-sm-3 control-label"></label>
  43.  
  44. <div class="col-sm-9">
  45. <img style="width: 200px; height: 50px;" src="https://www.google.com.pk/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png">
  46. </div>
  47.  
  48. </div>
  49.  
  50.  
  51. </div>
  52. <!-- /.box-body -->
  53. <div class="box-footer">
  54. <button type="submit" class="btn btn-info pull-right">Save</button>
  55. </div>
  56. <!-- /.box-footer -->
  57. </form>
  58. </div>
  59. <br /><br />
  60.  
  61. </div>
  62.  
  63. class adminController extends Controller
  64.  
  65. public function logo_change(Request $request)
  66. {
  67.  
  68. $this->validate($request, [
  69. 'logo' => 'required|image|mimes:png|max:2048',
  70. ]);
  71.  
  72. $imageName = 'logo.'.$request->image->getClientOriginalExtension();
  73. $request->image->move(public_path('images'), $imageName);
  74.  
  75. return back()
  76. ->with('success', 'Image Uploaded Successfully.')
  77. ->with('in path', $imageName);
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement