Palak27

Palak27

Developer at Ahmedabad

Member Since 1 Year Ago

Ahmedabad

Experience Points
9,320
Total
Experience

680 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
3
Lessons
Completed
Best Reply Awards
14
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 2
9,320 XP
Aug
02
2 months ago
Activity icon

Replied to Env () Is Null

Run command php artisan config:cache

And it is not best practice to use .env variable directly.

access it from config files

this is defined it mail.php

 'driver' => env('MAIL_DRIVER', 'smtp'),

So you can access it like

$driver = config('mail.driver');

Jun
03
4 months ago
Activity icon

Started a new Conversation Google Review With Callback Function??

hello everyone,

Does google review api provide any callback function?

I have admin panel with so many employee there. So when any employee send google review link to customer, so i want to track that if that customer sent feedback or not and by which employee that link was sent??

can any one help me ?

May
21
4 months ago
Activity icon

Replied to Is It Possible To Move A Folder To Another Folder With Storage Facade?

@yougotnet yes you can do it like this

Storage::move('Folder', 'OtherFolder/Folder');
Activity icon

Replied to Exclude Users If A User Relationship Exists

what issue you are facing while using doesntHave('relation') @

May
16
5 months ago
Activity icon

Replied to Fetch Model Attributes In Yajra Datatable

you can do this in two ways:

  1. you need to add each custom attribute in $appends array in model and fetch it using with relation like this https://stackoverflow.com/questions/46027252/yajra-datatable-custom-model-attribute

  2. Or you can add_column in Datatables like this https://yajrabox.com/docs/laravel-datatables/master/add-column

May
06
5 months ago
Activity icon

Replied to How To Only Return Collections Where No Other Relationship

@atmaboy why don't you use whereDoesntHave to check condition. and get only tasks. this is reference link https://laravel.com/docs/5.8/eloquent-relationships

    $query->where('content', 'like', 'foo%');
})->with('task_type')->paginate($tasksPerPage);
Apr
30
5 months ago
Activity icon

Replied to I Just Want To Redirect To The Route With Param From Controller Can You Please Help Me ?

So what's the issue in that you can directly do that by usong redirect()->route method instead of return json

return redirect()->route('profile', ['id' => 1]);

this will help you https://laravel.com/docs/5.8/redirects

Apr
26
5 months ago
Activity icon

Replied to S3 Url Issue In Laravel 5.5

may be something wrong in your configuration here is the link that can help you to configure s3 bucket settings. https://appdividend.com/2018/05/22/laravel-cloud-file-upload-tutorial-with-example

Apr
04
6 months ago
Activity icon

Replied to Using An API Key Alongside JWT Authentication

for api use can generate one random key for each user and store into database when send request you can validate token of particular user.

Apr
01
6 months ago
Activity icon

Replied to Yajra Datatable With Relationship

@fredemagi so you want to display how placed this order and also employee who will process this order.

Mar
27
6 months ago
Activity icon

Replied to Same Tab After Page Refresh

i have implement the same functionality for that when user click on tab i store that tab name into local storage than when ever page refresh i'll check if local storage have some value than show that tab like

$('a[data-toggle="pill"]').on('show.bs.tab', function(e) {
    localStorage.setItem('activeTab', $(e.target).attr('href'));
  });
var activeTab = localStorage.getItem('activeTab');
  if(activeTab){
    $('#myTab a[href="' + activeTab + '"]').tab('show');
  }
Mar
12
7 months ago
Activity icon

Replied to How To Design The Mail Template In Laravel5.5

you can make blade as per your design and send it to mail or you can use mandrill third integration to design own templates

Mar
06
7 months ago
Activity icon

Replied to Git Is Not Tracking My Config/database.php

@viremtechnologies

so your what ever changes you have done so far not reflected in your commit ?

Mar
04
7 months ago
Activity icon

Replied to Laravel Api | Social Networking | Vuejs

@talhaatsix

you can use jwt authentication fo rcustom auth and token multiple devices . here is the link for same https://github.com/tymondesigns/jwt-auth

Mar
03
7 months ago
Mar
01
7 months ago
Activity icon

Replied to Populate Field Values From Where() Parameter In HasMany() Relation

@v4np3rs13 you can't use BelongsToMany relation here because user hasMany Comments and one Comment belongs to one user only and why use explicitly enter 'hot' column value , can't you enter at a time of creating comment. and at a time of fetch use scopeQuery

Feb
13
8 months ago
Activity icon

Replied to Rendering Dynamic Content In Blade

@kshitizmittal

you have to extend layout in bidvw and bidashboard

@extends('layout')
@section('content')
    <p>Documented Verbal Warning</p>
@stop

@extends('layout')
@section('content')
    <p>This is my Dashboard content.</p>
@stop

Jan
24
8 months ago
Activity icon

Replied to In Bootstrap 4, Select Option Field Doesn't Support Required="true" For Simple Validation

@shamsul_huda

try

<span class="channel">
           <select class="selectpicker" name="channel_id" data-style="btn btn-link" id="exampleFormControlSelect1" required="required">
                 <option>Channel</option>

               @foreach($channels as $channel)
                  <option value="{{ $channel->id }}">{{ $channel->title }}   
                 </option>
               @endforeach

            </select>
  </span>
Jan
15
9 months ago
Activity icon

Replied to DB Transaction Rollback Runs There Is Exception

@michaelnguyen547

$result = DB::transaction(function () use($order){
try {
}catch (PaymentException $ex) {
     throw new Exception($ex);
    }
catch (RareException $e) {
    throw new Exception($ex);
}  catch (Throwable $e) {
 throw new Exception($ex);
}

  });
 return $result;
Jan
10
9 months ago
Activity icon

Replied to Method Illuminate\Database\Eloquent\Collection::join

@davy_yg

ApplicationModel::all() returns a collection of Eloquent models. You can't perform a join on that.

If you want to use joins, use the DB facade

Activity icon

Replied to Push To Nested Array

@petritr

 foreach ($Groups as &$Group) {
            foreach ($Group['port'] as &$item) {
                if ( ($item['services']) ) {
                    $item['services']= "name";
                    var_dump($item['services']);
                }
            }
        }
Jan
08
9 months ago
Activity icon

Replied to Send Mail On Model Created

@ahoi

run this command in sequance

php artisan clear-compiled
composer dumpautoload
Activity icon

Replied to Get Difference From Object And Array

@petritr

to check value exists of not you can use in_array() function

https://www.w3resource.com/php/function-reference/in_array.php

Activity icon

Replied to Custom Email Message

@davy_yg below input tag put error message

<input type="email" class="form-control" id="email" name="email" placeholder="[email protected]">

  @if ($errors->has('email'))
     <span class="help-block">
                <strong class="validation-message">{{ $errors->first('email') }}</strong>
         </span>
    @endif
Jan
04
9 months ago
Activity icon

Replied to Image.onload()

@hossamali

instead of Image use FileReader

  $('#new_image').change(function () {
    var reader = new FileReader();
    reader.onload = function (e) {

     
     
    }
    reader.readAsDataURL($(this)[0].files[0]);
  });
Activity icon

Replied to Catching Errors With Stripe?

@gabotronix

try{
             Stripe::setApiKey(config('services.stripe.secret'));

            $customer = Customer::create([
                "email" => $request->input('email'),
                "source" => $request->input('sourceId'),
            ]);

            $user = new User;
            $user->name = $request->input('name');
            $user->password = bcrypt($request->input('password'));
            $user->stripeCustomerId = $customer->id;
            $user->save();

            Auth::login($user);

            return response()->json([
                'message' => 'It worked!',
            ]);

        }
                           catch (\Stripe\Error\ApiConnection $e) {
                                /* Network problem, perhaps try again. */
                                
                                return response()->json([
                'message' => 'Sorry, Network is having trouble. Please try again later.',
            ]);
                              } catch (\Stripe\Error\InvalidRequest $e) {
                                /* You screwed up in your programming. Shouldn't happen! */
                                     return response()->json([
                'message' => 'Sorry. One of our programmer forgot to drink their caffein.',
            ]);
                              } catch (\Stripe\Error\Api $e) {
                                /* Stripe's servers are down! */
                                     return response()->json([
                'message' => 'Sorry our payment processor is down at the moment.',
            ]);
                              } catch (\Stripe\Error\Card $e) {
                                /* Card was declined. */
                                      return response()->json([
                'message' => 'Your card is declined. Please try with a different card.',
            ]);
                              }
Jan
03
9 months ago
Activity icon

Replied to Combine GroupBy And WithCount Query

@faroutchris

you can get data with events like

    $this->with('events')->all()->groupBy('group')
Dec
21
9 months ago
Activity icon

Replied to Convert Custom Query In Laravel

@kshitizmittal

you have to make two Eloquent model one is Employee and second is Reports

in employee model define the relationship with report

if employee has many reports than relationship will be

public function punchreports()
    {
        return $this->hasMany('App\Reports');
    }

and query will be

Employee::with([    
    'punchreports' => function($query) {
          $query->where('date',"2018-12-03)
    }

])->where('status',"Active")->get();

Activity icon

Replied to Mark All Fields Fillable In Model

@pavlen

If you would like to make all attributes mass assignable, you may define the $guarded property as an empty array

according to document

Activity icon

Replied to Redirect With Errors Not Working...

@jpeterson579

use this

$validation = User::validateUpdatePersonalDetails($input,$id)->validate();
Dec
18
10 months ago
Activity icon

Replied to How To Pass The Csrf_token To My View Using Ajax Jquery

@marioeid

istead of {{ csrf_field() }} in form

try this

<input type="hidden" name="_token" value="{{ csrf_token() }}">
Activity icon

Replied to How To Pass The Csrf_token To My View Using Ajax Jquery

@marioeid

you can't pass like this

$('#posts').append('<a data-token="{{csrf_token()}}"></a>');

if you have used post method then make a from like

   $('#posts').append('<li class="arrow_box col-md-10 col-lg-10 offset-lg-1">
<p><span id="title">'+data.data.title+'</span><br/>
<span id="body">'+data.data.body+'</span><br/>
<div class="info">
    <p> 
        <div id="funform"> 
            <div>'+data.data.created_at+'</div>
         <from action = "/deletepost/'+data.data.id" method="post"> 
               {{ csrf_field() }}
            <a  class="fa fa-trash post_delete"></a>
         </from>
            <a class="fa fa-thumbs-up post_like"></a>   
            <a class="fa fa-comment post_comment"></a> 
            <a class="fa fa-edit post_edit" </a></a> 
         </div> 
    </p>  
</div>
</p>
</li>');
Activity icon

Replied to This Page Isn’t Working 127.0.0.1 Redirected You Too Many Times Pagination Error

@shawdow instead of redirect you can return view paginate method automatic handle page

f($flag === "ajax"){

            return view('product', compact('pro_category'))->render();

        }else{

            return view('product')->with(['cat'=>$pro_category]);

        }
Activity icon

Replied to How To Pass The Csrf_token To My View Using Ajax Jquery

@marioeid In your data you can pass csrf_token like this

"data": { _token: "{{csrf_token()}}" ,  postform : $(".postform").serialize()},
Activity icon

Replied to A Nested Query

@ehabafia try this

$products = Category::with(['product '=> function($query)  {
      $query->byUser(auth()->id());
    }
 ])->get();
Activity icon

Replied to How To Use WhereHas Inside Of Where?

@jonjie

no need to use return

    $targets = CustomerTargetsItem::where('delivery_date', '=', date_format(Carbon::today(), 'm/d/Y'))
        ->whereHas('customerTarget', function($query){
             $query->where('category_slug', 'scheduled_delivery_of_repaired_t12_48x48_and_euro');
        })
        ->where(function($query){
             $query->whereHas('replacement', function($query){
                     $query->where('status', 3)
                    ->whereDate('created_at', '=', Carbon::today());
                })
                ->orWhereHas('transfer', function($query){
                     $query->where('status', 3)
                        ->whereDate('created_at', '=', Carbon::today());
                });
        })
        ->groupBy('customer_id')
        ->orderBy('delivery_date', 'asc')
        ->select(['customer_id', DB::raw('sum(quantity) AS total')])
        ->get();
Dec
10
10 months ago
Activity icon

Replied to HTML5 Validation Multiple Forms

@petritr

in will start validating in a sequence as you have given in your template

Activity icon

Replied to HTML5 Validation Multiple Forms

@petritr if you use # it will consider it as id and you have given name to from and button so try this

if ($("form[name='save_device']").length > 0 ) {
        if (!$("form[name='save_device']")[0].checkValidity() ) {
            $("form[name='save_device']").each(function(){
                $(this).find("button[name="submit-new-hidden"]").click();
            });
        }
    }
Activity icon

Replied to After Login User, Redirect To Specific Path

@sanjayacloud

override authenticated method in your LoginController like this

public function authenticated(Request $request, $user)
  {
if(Auth::user()->role->name=='admin){
    return redirect('/Dashboard');
}else{

}
    
}
Dec
07
10 months ago
Activity icon

Replied to Laravel Send Sms Using Twilio

@modestasv

twilio sms api throw exception when wrong 'To phone number' given but anyway i handle that exception using try and catch

Dec
06
10 months ago
Activity icon

Replied to Usage Of Php Artisan?

@munazzil

To enable maintenance mode, execute the down Artisan command:

php artisan down

To disable maintenance mode, use the up command:

php artisan up

according to this https://laravel.com/docs/5.7/configuration

Activity icon

Started a new Conversation Laravel Send Sms Using Twilio

hello, folks anyone used twilio for sms ??

Activity icon

Replied to Laravel Query

@nishant_nayan thanks for appreciation

Activity icon

Replied to Laravel Query

@nishant_nayan

i have used using model eloquent this if this can halp you or you want raw query?

this is not the same you want but kind of


$collection = Orders::join('order_lines', 'order_lines.order_id', '=', 'orders.id')
                                            ->join('products', 'products.id', '=', 'order_lines.product_id')
                                            ->select('products.name', DB::raw('sum(order_lines.quantity) AS Total'))
                                            ->where('orders.user_id', $id)
                                            ->where('orders.created_at', '>=', $newdate)
                                            ->groupBy('order_lines.product_id')
                                            ->orderBy('Total', 'DESC')
                                            ->take(7)
                                            ->get()->toArray();