Some Important Code For Web Development In Laravel :
Toastr CDN Code :
CSS CDN : <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.css">
JS CDN : <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script>
Toastr code:
<script>
@if(Session::has('message'))
var type = "{{Session::get('alert-type','info')}}";
switch(type){
case 'info':
toastr.info("{{ Session::get('message') }}");
break;
case 'success':
toastr.success("{{ Session::get('message') }}");
break;
case 'warning':
toastr.warning("{{ Session::get('message') }}");
break;
case 'error':
toastr.error("{{ Session::get('message') }}");
break;
}
@endif
</script>
Toastr Notification Code :
if($category){
$notification = array(
'message' => 'Successfully Data Inserted',
'alert-type' => 'success'
);
return Redirect()->back()->with($notification);
}else{
$notification = array(
'message' => 'Something Went Wrong',
'alert-type' => 'error'
);
return Redirect()->back()->with($notification);
}
Sweetalert CDN:
JS CDN: <script src="{{ asset('https://unpkg.com/sweetalert/dist/sweetalert.min.js')}}"></script>
Sweetalert Notification:
<script>
$(document).on("click", '#delete', function(e){
e.preventDefault();
var link = $(this).attr("href");
swal({
title: "Are you want to delete?",
text: "Once delete, this will be permanently delete!",
icon: "warning",
buttons: true,
dangerMode: true,
})
.then((willDelete) => {
if (willDelete) {
window.location.href = link;
} else {
swal("Safe Data");
}
});
});
</script>
Intervention Image :
composer require intervention/image
After you have installed Intervention Image, open your Laravel config file config/app.php
and add the following lines.
In the $providers
array add the service providers for this package.
Intervention\Image\ImageServiceProvider::class
Add the facade of this package to the $aliases
array.
'Image' => Intervention\Image\Facades\Image::class
Publish configuration in Laravel
$ php artisan vendor:publish --provider="Intervention\Image\ImageServiceProviderLaravelRecent"
Socialite Website:
https://console.developers.google.com/
https://www.tutsmake.com/laravel-8-socialite-github-login-tutorial/
Comment :
https://developers.facebook.com/docs/plugins/comments/#configurator
Mailtrap:
https://mailtrap.io/
important
ReplyDelete