phphupptechnologies

phphupptechnologies

PHP / Laravel Developer at Hupp Technologies at Ahmedabad

Member Since 1 Year Ago

Experience Points
3,290
Total
Experience

1,710 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.

Level 1
3,290 XP
Oct
02
2 weeks ago
Activity icon

Replied to Undefined Variable: Filename

Have you define enctype="multipart/form-data" in your form ? If you not define then file will come in request.

Sep
03
1 month ago
Activity icon

Started a new conversation How Can I Avoid To Stop Writting Script In Ckeditor ?

In my project there are lot of use of ckeditor. So users add easily their java script/Jquery script in ck editor. When do I try to show this text with like {!! $template !!} then its script run and when I try like {{ $template }} then script not run but HTML not show correctly.

Can anyone help me ?

Jul
02
3 months ago
Activity icon

Replied to 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 ?

Jun
28
3 months ago
Activity icon

Replied to Password Validate Rules

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

Jun
26
3 months ago
Activity icon

Replied to Password Validate Rules

@FABRICECW - I used your regex but return all string as invalid

Activity icon

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.

May
31
4 months ago
Activity icon

Replied to 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', // Add email unique validation here 
         ]);
    
        $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');
    }
May
16
5 months ago
Activity icon

Replied to 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>
Activity icon

Replied to No Message Error

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

Activity icon

Replied to 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/*',
    ];
May
15
5 months ago
Activity icon

Replied to 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>

May
13
5 months ago
Activity icon

Replied to Validation Date

use like below

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

Replied to 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
            })
    });
Activity icon

Replied to Uploading A File Error

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

May
03
5 months ago
Activity icon

Replied to Array Issue

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

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

Hope this will help you.

May
02
5 months ago
Activity icon

Replied to 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>

If you want to see demo find here. https://jsfiddle.net/46vpdmbo/ It work and will help you.

Apr
27
5 months ago
Activity icon

Replied to 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();

Activity icon

Replied to 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>
Activity icon

Replied to 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

Activity icon

Replied to 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>
Activity icon

Replied to 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]')
});
Activity icon

Replied to I Want To Create Two Types User Panel For Two Types User.

@towhid Okay. tell me if you face any issues.

Activity icon

Replied to 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

Activity icon

Replied to 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]dex');        
});
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]');     
});

No need change code in your existing project just follow above step. Hope this is work for you

Dec
31
9 months ago
Activity icon

Replied to Could Csrf Meta Be Used In HTML Forms?

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

Add this code in your main layout file

Oct
15
1 year ago
Activity icon

Replied to 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
             }
           
   }
Oct
13
1 year ago
Activity icon

Replied to 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',
        ]);