Saturday, 23 December 2017

Update Function Modal Box

I encountered the same problem, here is how i solved it. My modal is on the index.blade page, as follows:
<a data-toggle="modal" role="button" href="{{ URL::to('user/'.$user->id.'/edit') }}" class="btn btn-default"><i class="icon-pencil"></i></a>
Then the modal:
    <!-- Form modal -->
            <div id="edit_modal" class="modal fade" tabindex="-1" role="dialog">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title"><i class="icon-paragraph-justify2"></i> Edit User</h4>

                        <!-- Form inside modal -->
                        {!! Form::model($user,array('route' => ['user.update', $user->id],'method'=>'PATCH')) !!}

                            <div class="modal-body with-padding">                               
                                <div class="form-group">
                                    <div class="row">
                                    <div class="col-sm-12">
                                        <label>First name</label>
                                        <input type="text" class="form-control" placeholder="Chinedu"
                                         name="name" value="{!! $user->name !!}">
                        {!! Form::close() !!}

$(function() {
My controller methods are:
public function index()
        //View all users
        $users= User::orderBy('name', 'ASC')->paginate(10);
        return view('user.index',compact('users'));

public function edit($id)
        $users= User::orderBy('name', 'ASC')->paginate(10);
        $user= User::findOrFail($id);
        return view('user.index',compact('users','user'));
Hope this helps


Thursday, 21 December 2017

Bootstrap Template Admin Starter Pack

Soft Admin

SB Admin 2

Wednesday, 20 December 2017

Send SMS Laravel Nexmo


Basic Tutorial

Basic SMS guide

Through Packagist guide

Some Problem that might occured :

cURL error 60: SSL certificate problem: self signed certificate in certificate chain

While on local-host with Laravel you can easily bypass cURL error.
navigate to Client.php file (vendor\guzzlehttp\guzzle\src\Client.php)
Change "verify" to false
$defaults = [
        'allow_redirects' => RedirectMiddleware::$defaultSettings,
        'http_errors'     => true,
        'decode_content'  => true,
        'verify'          => false,
        'cookies'         => false