phphupptechnologies

phphupptechnologies

Member Since 1 Year Ago

PHP / Laravel Developer at Hupp Technologies at Ahmedabad

Experience Points 3,220
Experience Level 1

1,780 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 1
Lessons
Completed
Best Reply Awards 5
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

02 Jul
2 weeks ago

phphupptechnologies left a reply on Password Validate Rules

@snapey Thanks for your good suggestion. I understand you but I need it. Do you know how to make regex which match sequence number in string ?

28 Jun
2 weeks ago

phphupptechnologies left a reply on Password Validate Rules

I want like that password contain series like abcde / 12345 then its return wrong or invalid @munazzil @s

26 Jun
3 weeks ago

phphupptechnologies left a reply on Password Validate Rules

@FABRICECW - I used this but return all string as invalid

phphupptechnologies started a new conversation Password Validate Rules

I want to validate password like no repetitive characters (aaaa) or following (abcde / 12345). so how can I validate password using password validate rules or how can I make regex for avoid sequences string or number in password.

31 May
1 month ago

phphupptechnologies left a reply on How To Fix Duplicate Entry Error In Laravel 5.7?

Try below code.

protected function store(Request $request)
    {
    $request->validate([
             'email' => 'email|unique:users,email',
        ]);
    
        $user = new User;

        $user->email = $request->input('email');
        $user->name = $request->input('name');
        $user->address = $request->input('address');
        
        $user->save();

        $verifyUser = VerifyUser::create([
            'user_id' => $user->id,
            'token' => str_random(40)
        ]);

        Mail::to($user->email)->send(new VerifyMail($user));

       return redirect()->back()->with('info','We sent you an activation code. Check your email and click on the link to verify');
    }
16 May
2 months ago

phphupptechnologies left a reply on Not Working Laravel And Ajax Data Insert In To The Database

try below code

<script>
$('#insert').click(function(){
    $.ajax({
        type:'post',
        url:"{{url('insertdata}}",
        data:{
            '_token':$('input[name:_token').val(),
            'name':$('input[name:name').val(),
            'age':$('input[name:age').val(),
            'email':$('input[name:email').val(),
            'address':$('input[name:address').val(),
        },
        success:function(data){
            window.location.reload();
        },
    });
});
</script>

phphupptechnologies left a reply on No Message Error

Have you try to find out your route with using php artisan route:list and also try php artisan route:cache ?

phphupptechnologies left a reply on Laravel Csrf Token Mismatch In POST Request With URL

first check your route using this command php artisan route:list. If have any prefix then add prefix before response/* otherwise try like below in yourVerifyCsrfToken.php

protected $except = [
        'response/*',
    ];
15 May
2 months ago

phphupptechnologies left a reply on DataTables Sorting & Searching Not Working

just ignore tbody in foreach loop like below

 <table class="table table-striped table-bordered" id="table_id">
            <thead>
                    <tr>
                            <th>Case Number</th>
                            <th>Case Form</th>
                            <th>Patient Name</th>
                            <th>Date Created</th>
                            <th>Status</th>
                    </tr>
            </thead>
            
            <tbody>
             @foreach ($project as $project)
             <tr>
                
                 <td> <a href="/smiledesign/{{$project->id}}/userproject">{{$project->case_number}}</a></td>
                
                 @if ($project->services0)
                 <td> <a href="/smiledesign/{{$project->id}}/userproject">{{$project->services0}}</a></td> 
                 @elseif ($project->services1)
                 <td> <a href="/smiledesign/{{$project->id}}/userproject">{{$project->services1}}</a></td> 
                 @elseif ($project->services2)
                 {{-- <td> <a href="/smiledesign/{{$project->id}}/userproject">{{$project->services2 . '  '  . $project->mockup0}}</a></td>  --}}
                 <td> <a href="/smiledesign/{{$project->id}}/userproject">{{$project->services2 . '  '  . $project->mockup0 . ' ' . $project->mockup1}}</a></td> 

                 @endif

             </tr>
    @endforeach
         </tbody>
         

     </table>

13 May
2 months ago

phphupptechnologies left a reply on Validation Date

use like below

Validator::make($request->all(), [
            'date' => 'required|date_format:d/m/Y', //date_format:Y-m-d
        ])->validate();

phphupptechnologies left a reply on Upload An Image Using Modal

try like below

<form id="giveIdHere" enctype="multipart/form-data">
@csrf

$('#modal-save').on('click',function(){
        //create ajax request
    var formData = new FormData($('#giveIdHere'))
        $.ajax({
            method: 'POST',
            url: urlEdit, //url route is defined in the dashboard html script
            //pass the post content and id to body and postId which will be used in the Post controller edit method
            //need the token to avoid error
            data: formData,
        })
            .done(function (msg){
                //console.log(msg['message']);
                //console.log(JSON.stringify(msg));
                $(postBodyElement).text(msg['new_content']);    //update the post w/o refreshing the page
                $('#edit-post').modal('hide');  //hide the modal
            })
    });

phphupptechnologies left a reply on Uploading A File Error

Have you add in form enctype attribute like enctype="multipart/form-data" ?

03 May
2 months ago

phphupptechnologies left a reply on Array Issue

Try In your html like below then you can achieve your post array

<input type="text" name="dispatch_qty[$subjob_id]" >

Hope this will help you.

02 May
2 months ago

phphupptechnologies left a reply on Add Column With Javascript But Cant Add Another One

Do just like below code

<script type="text/javascript">
var count=0;
document.getElementById("medicine_btn").addEventListener("click", function(event){
    event.preventDefault()
    var tr = document.createElement("TR");
    var td0 = document.createElement("TD");
    var td1 = document.createElement("TD");
    var input0 = document.createElement("INPUT");
    var input1 = document.createElement("INPUT");
    input0.setAttribute('type', 'text');
    input0.setAttribute('class', 'form-control');
    input1.setAttribute('type', 'text');
    input1.setAttribute('class', 'form-control');
    //
    count++
    form = document.getElementById('medicine_form');
    input0.setAttribute('name', 'no'+count);
    input1.setAttribute('name', 'medicine'+count);
    //
    td0.appendChild(input0);
    td1.appendChild(input1);
    //
    tr.append(td0,td1);
    console.log(count,tr)
    console.log("forms",form)
    form.append(tr);
    console.log(count);
});
</script>

It work and will help you.

27 Apr
2 months ago

phphupptechnologies left a reply on Delete Conformation Dialogue Box

@ludo1960 Can you give me route name of delete function ? and put this route instead of "{{route('permissions.destroy')}}"+id like you have edit {{ URL::to('permissions/'.$permission->id.'/edit') }}

and put below code in you success function location.reload();

phphupptechnologies left a reply on Delete Conformation Dialogue Box

@ludo1960 try this in your blade file

@foreach ($roles as $role)
    <tr>

        <td>{{ $role->name }}</td>

        <td>{{ str_replace(array('[',']','"'),' ', $role->permissions()->pluck('name')) }}</td>{{-- Retrieve array of permissions associated to a role and convert to string --}}
        <td >
        <a href="{{ URL::to('roles/'.$role->id.'/edit') }}" class="btn btn-info pull-left" style="margin-right: 3px;">Edit</a>

        <button class='delete btn btn-danger pull-right' onclick="deleteFunction('{{$role->id}}')">Delete</button>
        </td>
    </tr>
@endforeach

<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script type="text/javascript">
function deleteFunction(id) {

    swal({
      title: "Are you sure?",
      text: "Once deleted, you will not be able to recover this imaginary file!", 
      icon: "warning",
      buttons: {
        confirm: {
          text: "Ok",
          value: true,
          visible: true,
          className: "btn btn-success",
          closeModal: true
        },
        cancel: {
          text: "cancel",
          value: null,
          visible: true,
          className: "btn btn-danger",
          closeModal: true,
        }
      },
      dangerMode: true,
      confirmButtonColor: '#3f51b5',
      cancelButtonColor: '#ff4081'
    })
    .then((willDelete) => {
        if (willDelete) {
            $.ajax({
            type: "DELETE",
            url: "{{route('permissions.destroy')}}"+id, // add your delete route
            success: function (data) {
                //here succes code 
            }
        });
      }
    });
}
</script>

phphupptechnologies left a reply on How To Format Nested Set Table Data To Work In JsTree?

Use below code for achieve your response for JsTree.

<?php 

public function getTree()
{
    $nodes = $this->category->orderByDepth();
    // here need pass to query result array 
    $arr = $this->xyz($nodes);
    return $arr;
} 

// Function for achieve response.

function xyz($parents,$parent_id = 0){
    $res = [];
    foreach ( $parents as $parent ) {
        if ( $parent["parent_id"] == $parent_id ){
            $children = $this->xyz($parents, $parent["id"]);
            if ($children) {
                 $parent["children"] = $children;
            } 
            $res[]=$parent;
        }
    }
    return $res;
}

Note below things for above function

  • This response base on the value of parent_id.

  • The condition is: when parent_id is equal to id, then the parent_id is considered as children of the id.

  • Please note that both parent_id and id are stored as incremental values in my function.

Hope this will work for you

phphupptechnologies left a reply on Delete Conformation Dialogue Box

for delete confirmation use sweetalert library and below have link for it https://sweetalert.js.org/guides/ for delete use below code as my suggestion

<button class='delete btn btn-danger pull-right' onclick="deleteFunction('{{$permission->id}}')">Delete</button>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script type="text/javascript">
function deleteFunction(id) {

    swal({
      title: "Are you sure?",
      text: "Once deleted, you will not be able to recover this imaginary file!", 
      icon: "warning",
      buttons: {
        confirm: {
          text: "Ok",
          value: true,
          visible: true,
          className: "btn btn-success",
          closeModal: true
        },
        cancel: {
          text: "cancel",
          value: null,
          visible: true,
          className: "btn btn-danger",
          closeModal: true,
        }
      },
      dangerMode: true,
      confirmButtonColor: '#3f51b5',
      cancelButtonColor: '#ff4081'
    })
    .then((willDelete) => {
        if (willDelete) {
            $.ajax({
            type: "DELETE",
            url: "{{route('permissions.destroy')}}"+id,
            success: function (data) {
                //here succes code 
            }
        });
      }
    });
}
</script>

phphupptechnologies left a reply on I Want To Have Middleware On Register The Default Auth. How Do I Do Please Help

Create middlewere which contain code like below under handle function

if (Auth::user() &&  Auth::user()->role == 'superadmin') {
        return $next($request);
}else{
    return response()->view('accessDenied.401');
}

in your route file,code like below

Route::group(['middleware' => ['checkRole']], function() { // I have take checkRole middlewere Route::get('register','[email protected]') });

phphupptechnologies left a reply on Laravel 5.8 Redirect Not Working

check route list by using below command in your terminal/cmd php artisan route:list find your route and check that have you call any auth or any other middlewere which use for unauthorized ? if find then this middlewere remove

phphupptechnologies left a reply on I Want To Create Two Types User Panel For Two Types User.

First add level column in your main user table after adding just make middleware by using below php artisan make:middleware CheckLevel and put below code in your created middlewere

/**
     * Handle an incoming request to check is it administrator or not.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next, $level1, $level2 = null, $level3 = null)
    {
        if (Auth::user() &&  Auth::user()->level == $level1) {
            return $next($request);
        } elseif(Auth::user() && $level2 != null && Auth::user()->level == $level2) {
            return $next($request);
        } elseif(Auth::user() && $level3 != null && Auth::user()->level == $level3) {
            return $next($request);
        } else {
            return response()->view('accessDenied.404');
        }
    }

Now changes your route file according to role like below

Route::group(['middleware' => ['CheckLevel:level1']], function() {
    /****Level1 Route****/
    Route::get('level1','[email protected]');        
});
Route::group(['middleware' => ['CheckLevel:level2']], function() {
    /****Level2 Route****/
    Route::get('level2','[email protected]');        
});
Route::group(['middleware' => ['CheckLevel:level1,level2']], function() {
    /****Level1and level2 mix Route****/
    Route::get('level1/level2','[email protected]');     
});
31 Dec
6 months ago

phphupptechnologies left a reply on Could Csrf Meta Be Used In HTML Forms?

$('form').append('{{csrf_field()}}');

Add this code in your main layout file

15 Oct
9 months ago

phphupptechnologies left a reply on How To Create A Custom Login With Md5 Encryption?

 public function login(Request $request)
    {
            $user = Users::where('user', $request->username)
                ->where('password', md5($request->password))
                ->first();
             if($user){   
                 Auth::login($user);
                 return redirect('/');
         }else{
        // redirect your login page
             }
           
   }
13 Oct
9 months ago

phphupptechnologies left a reply on Custom Validation Comparing Dates In Laravel

Use below validation

       $validation = $this->validate($request, [
              'departure_date' => 'required|date|after:now',
              'return_date' => 'required|date|after:departure_date',
        ]);