<script type="text/javascript">
	$(document).ready(function (e) {
		$("#profile_update").submit(function(e) {
	        e.preventDefault();
	        var site_title = $("#site_title").val();
	        var site_mail = $("#site_mail").val();
	        var site_contact = $("#site_contact").val();
	        var site_address = $("#site_address").val();
	        if (site_title == "" || site_mail == "" || site_contact == "" || site_address == "") {
	        	swal("{{trans('admin.empty_fields_are_not_allowed')}}","warn");
	        }else{
	        	loading();
		        var form_data = new FormData(this);
		        $.ajax({
		            url: '/site_info/update',
		            type: 'POST',
		            data: form_data,
		            headers: {
			            'X-CSRF-TOKEN': '{{ csrf_token()}}'
			        },
		            contentType: false,
			        processData: false,
			        cache: false,
			        dataType: 'json',
		            
		        })
		        .done(function (res) {
		           swal(res.text,res.cls);
		        })
		        .fail(function () {
		            console.log("error");

		        }).always(function(){
		        	loading("stop");
		        });
	        }
	    });
	});
</script>