Topic: php

Stripe Refund Api Tutorial Example From Scratch 0

Stripe Refund Api Tutorial Example

Today, We want to share with you Stripe Refund Api Tutorial Example.In this post we will show you stripe connect api, hear for stripe cancel subscription refund we will give you demo and example for implement.In this post, we will learn about stripe cancel subscription using curl in php with an example.

Stripe Refund Api Tutorial Example

There are the Following The simple About Stripe Refund Api Tutorial Example Full Information With Example and source code.

As I will cover this Post with live Working example to develop stripe cancel subscription At Period End using curl php, so the Stripe Authentication with Connect using PHP for this example is following below.

$ch = Stripe_Charge::retrieve('ch_19DAkJDKgNbxQsQZsCDh98La');
$ch->refunds->create(array('amount' => 100));

How to do refund in Stripe PHP?

You can also do refund as below

\Stripe\Stripe::setApiKey("sk_test_kfjdIFNOtvieiPAKAvc9qFwJ");

 $refund = \Stripe\Refund::create([
            'charge' => 'ch_19DAkJDKgNbxQsQZsCDh98La',
            'amount' => 1000,  // For 10 $
            'reason' => 'refund'
        ]);

$balanceLiveTransaction = \Stripe\BalanceTransaction::retrieve($refund->balance_transaction);

stripe cancel subscription using curl in php

stripe cancel subscriptionCanceling subscriptions Example

curl https://api.stripe.com/v1/subscriptions/sub_B49U3PAKAINFO8Onp \
   -u sk_test_kfjdIFNOtvieiPAKAvc9qFwJ: \
   -X DELETE

Source Code for stripe cancel subscription using curl in php
function delete_curl($path)
{
    // Add Stripe your key
    $headers = array('Authorization: Bearer sk_test_kfjdIFNOtvieiPAKAvc9qFwJ');
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_URL, $path);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    $result = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);  
    curl_close($ch);
    return $result;
}
 //Stripe Refund Api Tutorial Example
// add your simple subscriptions id
$path = "https://api.stripe.com/v1/subscriptions/sub_B49U3PAKAINFO8Onp";
$delete_curl = delete_curl($path);
echo "<pre>";
print_r($delete_curl);
echo "</pre>";

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Stripe Refund Api Tutorial Example.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Laravel JSON Encode Decode Handling 0

Laravel JSON Encode Decode Handling

Today, We want to share with you Laravel JSON Encode Decode Handling.In this post we will show you Convert and Loop through JSON with Laravel, hear for get data from json array in Laravel 5.7 we will give you demo and example for implement.In this post, we will learn about get the data from an array of JSONarray from Laravel 5.7 with an example.

Laravel JSON Encode Decode Handling

There are the Following The simple About Laravel JSON Encode Decode Handling Full Information With Example and source code.

As I will cover this Post with live Working example to develop Handling JSON Data in Laravel 5.7, so the laravel 5.7 return view with json data for this example is following below.

JSON encoded database column

[{
    "title": "Vuejs",
    "points": 0,
    "tags": [{
        "type": "Core",
        "uid": 45
    }]
}, {
    "title": "Angularjs",
    "points": 2,
    "tags": [{
        "type": "MVC",
        "uid": 1
    }]
}]

Laravel 5.7 – Get specific array in JSON encoded database column

$postData = json_decode($post->data, true);
dd($postData);

json decode laravel controller

Laravel Decode JSON

foreach (json_decode($response) as $area)
{
	print_r($area);
}

Encoding JSON Data

<?php
// An associative array
$marks = array("Vuejs"=>65, "Laravel"=>80, "PHP"=>78, "Angularjs"=>90);
 
echo json_encode($marks);
?>

Decoding JSON Data

<?php
$json = '{"Vuejs":65,"Laravel":80,"PHP":78,"Angularjs":90}';
 
var_dump(json_decode($json));
?>

Laravel Controller and Route Setup

create a new controller in Laravel 5.7

php artisan make:controller HomeController

# app/Http/Controllers/HomeController.php
...
use App\Product;

class HomeController extends Controller
{
    public function getProducts() {
        $products = Product::all();
        return $products;
    }
}

Formatting JSON data in Laravel

json_encode() to simple way to encode arrays into JSON string format.

$array = array('JavaScript','Magento','Vuejs');
return json_encode($array);

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Laravel JSON Encode Decode Handling.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

PHP Image Rotate Resize and Save Examples 0

PHP Image Rotate Resize and Save

Today, We want to share with you PHP Image Rotate Resize and Save.In this post we will show you php resizing image on upload rotates, hear for Manipulating Images in PHP Using GD we will give you demo and example for implement.In this post, we will learn about php rotate image without quality loss with an example.

PHP Image Rotate Resize and Save

There are the Following The simple About PHP Image Rotate Resize and Save Full Information With Example and source code.

As I will cover this Post with live Working example to develop Open Image, rotate, resize and save, so the Rotate and Save an image using PHP for this example is following below.

Example for PNG File:

<?php
    $uploadFilenm = "pakainfo25041992.png";
    $degrees = 90;
    $orignal_file = imagecreatefrompng($uploadFilenm);
    $rotate = imagerotate($orignal_file, $degrees, 0);
    imagepng($rotate, "changeUpdatFile.png");
    print_r('Your Live Image/Files saved successfully.');
?>

Example for JPEG File:

<?php
    
    $uploadFilenm = "pakainfo25041992.jpeg";
    $degrees = 90;
    $orignal_file = imagecreatefromjpeg($uploadFilenm);
    $rotate = imagerotate($orignal_file, $degrees, 0);
    imagejpeg($rotate, "changeUpdatFile.jpeg");
    print_r('Your Live Image/Files saved successfully.');
   
?>

Open Image, rotate, resize and save

<?php
   if(isset($_FILES['image'])){
      $dynamicErr= array();
      $orignal_file = $_FILES['image']['name'];
      $file_size =$_FILES['image']['size'];
      $file_tmp =$_FILES['image']['tmp_name'];
      $file_type=$_FILES['image']['type'];
      $file_ext=strtolower(end(explode('.',$_FILES['image']['name'])));
 
      $expensions= array("jpeg","jpg","png");
      
      if(in_array($file_ext,$expensions)=== false){
         $dynamicErr[]="extension not Any allowed, please select a JPEG or PNG file.";
      }
      
      if($file_size > 2097152){
         $dynamicErr[]='File size must be excately 2 MB';
      }
      
      if(empty($dynamicErr)==true){
         move_uploaded_file($file_tmp, $orignal_file);
         echo "Success";
      }else{
         print_r($dynamicErr);
      }

      $uploadFilenm = $orignal_file;
      $exif = exif_read_data($uploadFilenm);
      if(!empty($exif['Orientation'])) {
         switch($exif['Orientation']) {
                    case 8:
                        $degree = 90;
                        break;
                    case 3:
                        $degree = 180;
                        break;
                    case 6:
                        $degree = -90;
                        break;
                }
      $source = imagecreatefromjpeg($uploadFilenm) or notfound();
      $rotate = imagerotate($source,$degree,0);

      imagejpeg($rotate,$uploadFilenm);

      imagedestroy($source);
      imagedestroy($rotate);
      }

      echo '<img src="'.$orignal_file.'">';
   }
?>
<html>
   <body>
      
      <form action="" method="POST" enctype="multipart/form-data">
         <input type="file" name="image" />
         <input type="submit"/>
      </form>
      
   </body>
</html>

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about PHP Image Rotate Resize and Save.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Installing APC for php Accelerator xampp/WAMP 0

Installing APC for php Accelerator xampp/WAMP

Today, We want to share with you Installing APC for php Accelerator xampp/WAMP.
In this post we will show you How To install APC Cache on WAMP/XAMPP, hear for how to install PHP Accelerator in Xampp we will give you demo and example for implement.
In this post, we will learn about Installing APC for PHP 7 Accelerator xampp/WAMP with an example.

How to install PHP Accelerator in Xampp ?

The PHP first of all php accelerator download and It’s should Internationalization extension is used to php accelerator wamp/xampp, amongst more, by PHP based Symfony (for some more validators) for install and/or enable a php accelerator (highly recommended).

This php accelerator xampp extension allows you to write source codes like this one Example:

$php_accelerator_xampp_format = new NumberFormatter('en_US', NumberFormatter::DECIMAL);
echo $php_accelerator_xampp_format->format(1234567.89); // 1,234,567.89

$php_accelerator_xampp_format = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
echo $php_accelerator_xampp_format->format(1234567.89); // 1 234 567,89

$php_accelerator_xampp_format = new NumberFormatter('en_US', NumberFormatter::CURRENCY);
echo $php_accelerator_xampp_format->getTextAttribute(NumberFormatter::CURRENCY_CODE); // USD

$php_accelerator_xampp_format = new NumberFormatter('pt_BR', NumberFormatter::CURRENCY);
echo $php_accelerator_xampp_format->getTextAttribute(NumberFormatter::CURRENCY_CODE); // BRL

After that Therefor much more, including install and/or enable a php accelerator (highly recommended). prestashop formatting of currency, install and/or enable a php accelerator, number and date/time, php accelerator ampps as well as UCA-conformant collations php accelerator cpanel (customizable all the method to compare two php_apc.dll php 7 strings).

install php accelerator To activate this PHP simple install apc on xampp extension in Xampp, just simple edit your file Like as a php.ini (Example in C:\xampp\php folder) and remove the semicolon to uncomment this line :

;extension=php_intl.dll

Note : : Lastly You don’t forget to Your PHP restart Apache !

We hope you get an idea about How to install Alternative PHP Cache(APC) in Xampp
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

We hope This Post can help you…….Good Luck!.

PHP Array Length Size Count Tutorial With Example 0

PHP Array Length Size Count Tutorial With Example

Today, We want to share with you PHP Array Length Size Count Tutorial With Example.In this post we will show you php count array elements with specific value, hear for we will give you demo and example for implement.In this post, we will learn about PHP Count total items in a multidimensional array/ associative array with an example.

PHP Array Length Size Count Tutorial With Example

There are the Following The simple About PHP Array Length Size Count Tutorial With Example Full Information With Example and source code.

As I will cover this Post with live Working example to develop php array count values multidimensional array, so the Counts all elements in an array, or something in an object for this example is following below.

How to Count Array Elements in PHP

$num = array(1, 2, 3, array(4, 5, 6));
echo count($num)."\n";
echo count($num, 1);
//4 7

sizeof()

Array length Using PHP sizeof()

<?php

$mydata = array(5, 6, 7, array(8, 9, 10));
echo sizeof($mydata)."\n";
echo sizeof($mydata, 1);
//4 7
?>

PHP Indexed Arrays using Count

<?php
$product = array("Mobile", "Bike", "Computer");
$length = count($product);

for($x = 0; $x < $length; $x++) {
    echo $product[$x];
    echo "<br>";
}

How To Get Arrays Length

<?php
   $product = array("Mobile", "Bike", "Apple");
   $length = count($product);
   echo $length;
?>

Loop Through an Indexed Array

<?php
$product = array("Mobile", "Bike", "Computer");
$length = count($product);

for($x = 0; $x < $length; $x++) {
    echo $product[$x];
    echo "<br>";
}

PHP Loop Through an Associative Array

 $product = array("Mobile"=>"12566", "Bike"=>"98989", "Apple"=>"21");
 foreach($product as $x => $x_value) { 
 echo "Key=" . $x . ", Value=" . $x_value;
 echo "<br>";
}

Counting multidimensional arrays

php array count values multidimensional array

$devloperInfo = array( "devloper" => array( "Alfred shah", "Stanley sojitra", "Martin kumar", "deepak Lang" ),"languages" => array( "PHP", "Laravel", "Magento", "vuejs" ) );

// Displays "2"
echo count( $devloperInfo );

$devloperInfo = array( "devloper" => array( "mayur Hitchcock", "hitesh Kubrick", "Ravi Scorsese", "ketan Lang" ),"languages" => array( "PHP", "Laravel", "Angularjs", "Vuejs" ) );

// Displays "10"
echo count( $devloperInfo, COUNT_RECURSIVE );

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about PHP Array Length Size Count Tutorial With Example.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Laravel 5.7 Routing Required Parameter 0

Laravel 5.7 Routing Required Parameter

Today, We want to share with you Laravel 5.7 Routing Required Parameter.In this post we will show you laravel 5.7 routing Required parameters, hear for Routing Required parameters in laravel 5.7 we will give you demo and example for implement.In this post, we will learn about Route Required parameters in laravel 5.7 with an example.

Laravel 5.7 Routing Required Parameter

There are the Following The simple About Laravel 5.7 Routing Required Parameter Full Information With Example and source code.

As I will cover this Post with live Working example to develop route middleware,route parameters controller, so the some route redirect,get route parameters,get route name for this example is following below.

Example 1: Route with Required parameters

There are some more then 3 or more parameters pass which do not remain present within the web custom URL (Uniform Resource Locator), so the PHP or Laravel developers had to use them. Therefor Route parameters get indicated by a encapsulated within {} (curly-braces) with alphabets inside following source code the name of the URL parameter.

Route :: get ('product/{id}', function ($id) {
    echo 'Emp '.$id;
});

Example 2: Laravel (5.7) – Routing to controller with Required parameters

Required Route Parameter

You Can Also More Laravel Routing Examples Full Source Code ForLaravel Route pass multiple Parameters Examples

Routes.php

<?php
 
Route::get('products/{id}', [
    'uses' => '[email protected]',
    'as' => 'company.products',
    'middleware' => ['auth'],
]);
 
Route::post('update/{updateId}', [
    'uses' => '[email protected]',
    'as' => 'update',
]);

ProductController.php

namespace Henri\Http\Controllers;
 
use Auth;
use Henri\Models\Company;
use Henri\Models\Product;
use Illuminate\Http\Request;
 
class ProductController extends Controller{
        public function productCompany(){
                $products = Product::whereUserId(Auth::user()->id)->get();
                return view('company.index')->with('products', $products);
            }
            
            public function getProducts($id){
                $products = Product::where('id', $id)->first();
                if(!$products){
                    if (Auth::check()) {
                        return redirect()->route('company')->with('info', 'We cannot find that product!');
                    }
                }
                return view('company.products')->with('products', $products);   
            }
            
            public function updateProduct(Request $request, $updateId){
                $this->validate($request, [
                    'body' => 'max:255',
                ]);
                
                $products= Product::where('id', $updateId)->first()->update([
                    'body' => $request['body'],
                ]);
                
                return redirect()->back()->with('info', 'Product was updated!');
            }
 
}

Product.blade.php

@include('templates.partials.alerts')
 
@if(Auth::user()->id != $products->user_id)
    View this <a href="news/{{$products->id}}"/>news</a> !
@else
    <form action="{{route('update')}}" method="post">
        {{$products->id}}
    <textarea class="edit" name='body'/>{{$products->body}}</textarea>
    <br/>
    <br/>
    <input type="submit" name="editSubmit" value="Edit Product"/>
    <input type="hidden" name="_token" value="{{csrf_token()}}"/>
    </form>
@endif

Example 3: laravel get request Required parameters

# Required Parameters Template Routes

Route::get('student/{id}', function ($id) {
    return 'Student ID:'.$id;
});

You may define as many Laravel 5.7 route parameters as required by your route:

Route::get('students/{student}/comments/{comment}', function ($studentId, $commentId) {
    //
});

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Laravel 5.7 Routing Required Parameter.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Laravel 5.7 Routing Optional Parameter 0

Laravel 5.7 Routing Optional Parameter

Today, We want to share with you Laravel 5.7 Routing Optional Parameter.In this post we will show you laravel 5.7 routing optional parameters, hear for Route optional parameters in laravel 5.7 we will give you demo and example for implement.In this post, we will learn about Routing optional parameters in laravel 5.7 with an example.

Laravel 5.7 Routing Optional Parameter

There are the Following The simple About Laravel 5.7 Routing Optional Parameter Full Information With Example and source code.

As I will cover this Post with live Working example to develop laravel 5.7 route wildcard, so the route resource,route middleware for this example is following below.

Example 1: Route with optional parameters

There are some more then 3 or more parameters pass which do not remain present within the web custom URL, so the PHP or Laravel developers had to use them. Therefor Route parameters get indicated by a ? (question mark sign) following source code the name of the URL parameter.

Route :: get ('product/{cat_id?}', function ($cat_id = null) {
    echo $cat_id;
});

Route :: get ('product/{name?}', function ($name = 'Mobile') {
    echo $name;
});

Example 2: Laravel (5.7) – Routing to controller with optional parameters

Optional Route Parameter

You Can Also More Laravel Routing Examples Full Source Code ForLaravel Route pass multiple Parameters Examples

Route::get('product/{name?}', function ($name = 'MyLaravelProject') { return $name;});

Example 3: laravel get request Optional parameters

# Optional Parameters Template Routes

# routes/web.php

Route::get('product/{name?}', function ($name = null) {
    return 'Name: '.$name;
});

Route::get('products/{name?}', function ($name = 'Iphone') {
    return 'Name: '.$name;
});

testing this Laravel routes

# product/{productname} routes:

http://localhost:8080/product
http://localhost:8080/product/hashvel

# products/{productname} routes:

http://localhost:8080/products
http://localhost:8080/products/hashvel

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Laravel 5.7 Routing Optional Parameter.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Simple Laravel Contact Us Form With Email Example 0

Simple Laravel Contact Us Form With Email Example

Today, We want to share with you Simple Laravel Contact Us Form With Email Example.In this post we will show you Create a Laravel Contact Us form with Email, hear for Laravel 5.7 Contact Form With File Attachment Script we will give you demo and example for implement.In this post, we will learn about Laravel 5.7 – Create Bootstrap Contact US Form using Form Request with an example.

Simple Laravel Contact Us Form With Email Example

There are the Following The simple About Simple Laravel Contact Us Form With Email Example Full Information With Example and source code.

As I will cover this Post with live Working example to develop Sending Email Messages in Laravel 5.7, so the Submit Contact Form in PHP Laravel 5.7 with toastr notifications jquery for this example is following below.

Setp 1 : Setup laravelcollective

Install Laravel Collective HTML Package with Install Laravel Application

cd myproject
cd myprojectname/public_html
composer require laravelcollective/html

config/app.php

// Laravel Add a Providers with aliases
'providers' => [
....
'Collective\Html\HtmlServiceProvider',
],
'aliases' => [
....
'Form' => 'Collective\Html\FormFacade',
],

Setp 2 : Database Configuration

the .env file >> Add the Laravel file settings credentials

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=example.db.name                                                                                               DB_USERNAME=example.db.username                                                                                           
DB_PASSWORD= example.db.password

Make Laravel Migrations for Feedback Us Table

php artisan make:migration create_feedback_us_table

database/migration/date_ create_feedback_us_table.php

increments('id'); $table->string('name'); $table->string('email'); $table->text('comment'); $table->timestamps(); });
    }

    public function down()
    {
       Schema::drop("feedbackus");
    }
}

Laravel run the following command

php artisan migrate

Setp 3 : Laravel Make The Model

Create a Laravel Model

php artisan make:model Feedback

app/Feedback.php

<?php

namespace App;
use Illuminate\Database\Eloquent\Model;
class Feedback extends Model
{

public $table = 'feedbackus';
public $fillable = ['name','email','comment'];

}

Setp 4 : Define Laravel the Route

routes/web.php

Route::get('feedback-us', '[email protected]');
Route::post('feedback-us', ['as'=>'feedbackus.store','uses'=>'[email protected]']);

Setp 5 : Make a Laravel Controller

app/Http/Controllers/FeedbackController.php

validate($request, [
        'name' => 'required',
        'email' => 'required|email',
        'comment' => 'required'
        ]);

       Feedback::create($request->all());

       return back()->with('success', 'Thanks for feedbacking us!');
   }
}

Setp 6 : Make Laravel the View

resources/views/Feedback.blade.php



<title>Laravel 5.7 Feedback Form Example</title>




<div class="pakainfo container">
<h1>Feedback Form</h1>
<p>Laravel Contact Form With File Attachment Script</p>

@if(Session::has('success'))
   <div class="alert alert-success">
     {{ Session::get('success') }}
   </div>
@endif

{!! Form::open(['route'=>'feedbackus.store']) !!}

<div>has('name') ? 'has-error' : '' }}">
{!! Form::label('Member Name:') !!}
{!! Form::text('name', old('name'), ['class'=>'Feedback form-control', 'placeholder'=>'Enter Member Name']) !!}
<span class="text-danger">{{ $errors->first('name') }}</span>
</div>

<div>has('email') ? 'has-error' : '' }}">
{!! Form::label('Member Email:') !!}
{!! Form::text('email', old('email'), ['class'=>'Feedback form-control', 'placeholder'=>'Enter Member Email']) !!}
<span class="text-danger">{{ $errors->first('email') }}</span>
</div>

<div>has('comment') ? 'has-error' : '' }}">
{!! Form::label('Comment:') !!}
{!! Form::textarea('comment', old('comment'), ['class'=>'Feedback form-control', 'placeholder'=>'Enter Member Comment']) !!}
<span class="text-danger">{{ $errors->first('comment') }}</span>
</div>

<div class="pakainfo form-group">
<button class="gst btn btn-success">Feedback US!</button>
</div>

{!! Form::close() !!}

</div>



email.blade.php

You received a comment from : {{ $name }}
<p>
Member Name: {{ $name }}
</p>

<p>
Member Email: {{ $email }}
</p>

<p>
Comment: {{ $user_comment }}
</p>

Laravel Sending the Email

php artisan make:mail 

first of all My account > Login as well as Security > Login to Google

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME= [email protected]
MAIL_PASSWORD= example.generated.app.password
MAIL_ENCRYPTION=tls

FeedbackUsController.php

validate($request, [ 'name' => 'required', 'email' => 'required|email', 'comment' => 'required' ]);
    Feedback::create($request->all()); 

    Mail::send('email',
       array(
           'name' => $request->get('name'),
           'email' => $request->get('email'),
           'user_comment' => $request->get('comment')
       ), function($comment)
   {
       $comment->from('[email protected]');
       $comment->to('[email protected]', 'Admin')->subject('Pakainfo Feedback');
   });

    return back()->with('success', 'Thanks for feedbacking us!'); 
   }
}

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Simple Laravel Contact Us Form With Email Example.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Laravel 5.7 Bootstrap Admin Panel Templates Integrate 0

Laravel 5.7 Bootstrap Admin Panel Templates Integrate

Today, We want to share with you Laravel 5.7 Bootstrap Admin Panel Templates Integrate.In this post we will show you Integrate admin template in Laravel 5.7, hear for Laravel Admin Packages to Use for Backend step by step we will give you demo and example for implement.In this post, we will learn about PHP Laravel 5.7 – Bootstrap Admin Theme Integration example from scratch with an example.

Laravel 5.7 Bootstrap Admin Panel Templates Integrate

There are the Following The simple About Laravel 5.7 Bootstrap Admin Panel Templates Integrate Full Information With Example and source code.

As I will cover this Post with live Working example to develop Laravel 5.7 Admin Panel Generators, so the Laravel 5.7 Admin Panel Generators for this example is following below.

Laravel Application Directory Structure

There are the following the list of the Simple Application Structure of Laravel 5.7 Framework

Laravel’s App Directory

  • Console
  • Exceptions
  • Http
  • –>Controllers
  • –>Middleware
  • Providers

Laravel’s Bootstrap Directory

  • bootstrap
  • –>cache

Laravel’s Config Directory

  • app.php
  • auth.php
  • broadcasting.php
  • cache.php
  • database.php
  • filesystems.php
  • mail.php
  • queue.php
  • services.php
  • session.php
  • view.php

Database Directory

  • database migrations
  • database seeds

Public Directory

  • images
  • js
  • css

Routes Directory

  • web.php
  • api.php
  • console.php

Storage Directory

Path : storage/app/public

Step 1: Install the Laravel 5.7

composer create-project laravel/laravel adminlaravel_template --prefer-dist

Laravel Define Route

Laravel define the route for the admin template.

Route::get('/', function () {
    return view('welcome');
});

Auth::routes();

Route::get('/home', '[email protected]')->name('home');

Step 2: Create a layout file called default.blade.php

default.blade.php
resources/views/layouts/default.blade.php

<!DOCTYPE html>
<html lang="en">
<head>
@include('includes.head')
</head>
<body>
    <div class="wrapper">
        @include('includes.header')
        @include('includes.sidebar')
        <!-- Contant -->
        <div class="content-wrapper">           
            @yield('content')
        </div>
        <!-- End Content -->
        @include('includes.footer')
    </div>
<!-- Script -->
<script src="{{ URL::asset('js/jquery-1.12.4.min.js') }}" type="text/javascript"></script> <!-- jquery min js -->
<script src="{{ URL::asset('js/bootstrap.min.js') }}" type="text/javascript"></script> <!-- bootstrap js -->
<script src="{{ URL::asset('js/jquery.dataTables.min.js') }}" type="text/javascript"></script> <!-- dataTables js -->
<script src="{{ URL::asset('js/dataTables.responsive.min.js') }}" type="text/javascript"></script> <!-- DataTables Responsive js -->    
<script src="{{ URL::asset('js/responsive.bootstrap4.min.js') }}" type="text/javascript"></script> <!-- Responsive Bootstrap4 js -->
<script src="{{ URL::asset('js/default.js') }}" type="text/javascript"></script> <!-- custom js -->
<script src="{{ URL::asset('js/sidebarmenu.js') }}" type="text/javascript"></script> <!-- custom js -->
<!-- End Script -->
<script>

</script>
@yield ('scripts')    
</body>
</html>

resources/views/includes/head.blade.php

<meta charset="UTF-8">
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<title>Your_Project_name InfoMedia</title>
<link rel="icon" href="{{ URL::asset('images/favicon.png') }}" type="image/x-icon" /> <!-- Favicon Icon -->

<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,500,600,700" rel="stylesheet"> <!-- Google Font -->

<link href="{{ URL::asset('css/bootstrap.css') }}" rel="stylesheet" type="text/css"/> <!-- Bootstrap -->
<link href="{{ URL::asset('css/responsive.bootstrap.min.css') }}" rel="stylesheet" type="text/css"/> <!-- Responsive Bootstrap  -->
<link href="{{ URL::asset('css/font-awesome.css') }}" rel="stylesheet" type="text/css"/> <!-- Font Awesome -->
<link href="{{ URL::asset('css/style.css') }}" rel="stylesheet" type="text/css"/> <!-- Custom css -->
<link href="{{ URL::asset('css/custom.css') }}" rel="stylesheet" type="text/css"/> <!-- Custom css -->
<link href="{{ URL::asset('css/responsive.css') }}" rel="stylesheet" type="text/css"/> <!-- Custom css -->

resources/views/includes/header.blade.php

<meta charset="UTF-8">
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<title>Your_Project_name InfoMedia</title>
<link rel="icon" href="{{ URL::asset('images/favicon.png') }}" type="image/x-icon" /> <!-- Favicon Icon -->

<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,500,600,700" rel="stylesheet"> <!-- Google Font -->

<link href="{{ URL::asset('css/bootstrap.css') }}" rel="stylesheet" type="text/css"/> <!-- Bootstrap -->
<link href="{{ URL::asset('css/responsive.bootstrap.min.css') }}" rel="stylesheet" type="text/css"/> <!-- Responsive Bootstrap  -->
<link href="{{ URL::asset('css/font-awesome.css') }}" rel="stylesheet" type="text/css"/> <!-- Font Awesome -->
<link href="{{ URL::asset('css/style.css') }}" rel="stylesheet" type="text/css"/> <!-- Custom css -->
<link href="{{ URL::asset('css/custom.css') }}" rel="stylesheet" type="text/css"/> <!-- Custom css -->
<link href="{{ URL::asset('css/responsive.css') }}" rel="stylesheet" type="text/css"/> <!-- Custom css -->

resources/views/includes/footer.blade.php

<!-- Footer -->
<!--<footer class="footer">
    <h3>Get in Touch with us:</h3>
    <p>For any Suggestion or any types of the help write us to <a href="mailto:[email protected]_Project_name.com"><i class="fa fa-envelope"></i> [email protected]_Project_name.com</a> or Skype : <a href="skype:john.sharma"><i class="fa fa-skype"></i> john.sharma</a></p>
    <p>If you have not gets any message or email from us after purchased this Product, please write us on <a href="mailto:[email protected]_Project_name.com"><i class="fa fa-envelope"></i> [email protected]_Project_name.com</a></p>          
</footer>-->
<!-- End Footer -->

resources/views/includes/sidebar.blade.php

<!-- Sidebar Menu -->
<aside class="main-sidebar">
    <section class="sidebar">
        <ul id="sidebarnav">
                <li {!! currentActivePath('home') !!}><a href="{{ url('home') }}" {!! selectedPath('home') !!}><i class="fa fa-tachometer"></i><span>Dashboard</span></a></li>
                <li {!! currentActivePath('products') !!}><a href="{{ url('products/active') }}" {!! selectedPath('products') !!}><i class="fa fa-ticket"></i><span>Active products</span> <span class="badge badge-pill badge-warning
">1</span></a> </li>
                <li {!! currentActivePath('complete') !!}><a href="{{ url('products/completed') }}" {!! selectedPath('complete') !!}><i class="fa fa-folder"></i><span>Completed products</span> <span class="badge badge-pill badge-warning
">1</span></a> </li>
                    <li {!! currentActivePath('cats') !!}><a href="{{ url('cats') }}" {!! selectedPath('cats') !!}><i class="fa fa-shopping-bag"></i><span>App's</span></a></li>
                    <li {!! currentActivePath('categories') !!}><a href="{{ url('categories') }}" {!! selectedPath('categories') !!}><i class="fa fa-sitemap"></i><span>Categories</span></a></li>
                    <li {!! currentActivePath('usertypes') !!}><a href="{{ url('usertypes') }}" {!! selectedPath('usertypes') !!}><i class="fa fa-sliders"></i><span>usertypes</span></a></li>
                    <li {!! currentActivePath('status') !!}><a href="{{ url('status') }}" {!! selectedPath('status') !!}><i class="fa fa-tasks"></i><span>Status</span></a></li>
                    <li {!! currentActivePath('auto-response') !!}><a href="{{ url('auto-response') }}" {!! selectedPath('auto-response') !!}><i class="fa fa-reply-all"></i><span>Canned response</span></a></li>
                    <li {!! currentActivePath('catinfos') !!}><a href="{{ url('catinfos') }}" {!! selectedPath('catinfos') !!}><i class="fa fa-list-ol"></i><span>cat's info</span></a></li>
                    <li {!! currentActivePath('spam-emails') !!}><a href="{{ url('spam-emails') }}" {!! selectedPath('spam-emails') !!}><i class="fa fa-envelope-open"></i><span>Spam Email's</span></a></li>
        </ul>
    </section>
    <!--<div class="user-icon">
        <a href="user.html" class="user-btn">
            <img src="images/user.svg" alt="">
        </a>
    </div>-->
</aside>
<!-- End Sidebar Menu -->

http/Controllers/HomeController.php

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class HomeController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('auth');
    }

    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        return view('home');
    }
}

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Laravel 5.7 Bootstrap Admin Panel Templates Integrate.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

PHP and Ajax Asynchronous File Upload using jQuery 0

PHP and Ajax Asynchronous File Upload using jQuery

PHP and Ajax Asynchronous File Upload using jQuery

In this Post We Will Explain About is PHP and Ajax Asynchronous File Upload using jQuery With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Upload File in PHP using Jquery AJAXExample

In this post we will show you Best way to implement Ajax File Upload with PHP, HTML5 File API and jQuery, hear for Upload Files Using jQuery Ajax and PHP Without Page Refreshwith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

The need to we should know before simple following this Post:
1.PHP
2.HTML
3.jQuery
4.CSS and
5.Bootstrap

Form and HTML Input Field: The basic simple need to upload Your file is to have HTML form tag with enctype=”multipart/form-data” add or put, if we offers the above file we have to added form with some file extentions enctype, next is the HTML input field of file type, as well as we have this input field with the ID like as a “my_live_file_upload”.

index.html(Make a HTML file and define markup)



<title>Pakainfo.com Demo - PHP File upload using jQuery Steps</title>



 
<div class="container">
	<div class="row">
		<div class="col-sm-12">
		<h2>Pakainfo.com Example of PHP File Upload using jQuery Step By Step</h2>
		</div>
	</div>
	<div class="row">
		<div class="col-sm-6 col-sm-offset-0">
			<div class="form-group">
			<form enctype="multipart/form-data">
			<label>Select Any File to Upload</label>
			
			</form>
			</div>
			<div class="form-group">
			<button class="btn btn-primary">Submit</button>
			</div>
		</div>
	</div>
</div>






Script.js(Make a js file and define scripting)

function fileuploads()
{
if($("#my_live_file_upload").val() != "")
{
var file_data = $('#my_live_file_upload').prop('files')[0];
var liveForm_data = new FormData();
 
liveForm_data.append('file', file_data);
 
	$.ajax({
		url: 'fileuploads.php', 
		dataType: 'text', 
		cache: false,
		contentType: false,
		processData: false,
		data: liveForm_data,
		type: 'post',
		success: function(data){
		     alert(data);
		$("#my_live_file_upload").val("");
		}
	});
}
else
{
	alert("Please Any select file!");
}
}

fileuploads.php(Server Side Page)

//check conditions using PHP
if ( 0 < $_FILES['file']['error'] ) {
echo 'Some Error: ' . $_FILES['file']['error'] . '<br>';
}
else
{
	//upload file using PHP
	move_uploaded_file($_FILES['file']['tmp_name'], 'files/' . $_FILES['file']['name']);
	echo "Your Live File uploaded successfully Good Luck!!";
}
?>

Example

I hope you have Got What is Ajax File Upload with PHP, HTML5 File API and jQuery And how it works.I would Like to have FeadBack From My Blog(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.