Saikishore

Saikishore

Member Since 4 Years Ago

Experience Points 6,230
Experience Level 2

3,770 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 16
Lessons
Completed
Best Reply Awards 5
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

26 Dec
3 months ago

Saikishore started a new conversation Change One Column Value When We Have HasMany Relation

Hi Team,

I am having Has many relational object which contains list of records. I need to change one column value if the value is something. I can't able to do foreach these has many relational object.

In User model appointments has many relation is there.

$results = $user->appointments()->whereIn('status', ['approved', 'rejected' ]);

If status is rejected, i need to send the response to 'xxxx' to api response. I am trying to change this by using getter atrribute in Model. but it is working only when we specifically calling $appoinment->status. this is not working for list of records.

26 Sep
6 months ago

Saikishore left a reply on Relational Records With Condition Based

Any solution for this?

25 Sep
6 months ago

Saikishore started a new conversation Relational Records With Condition Based

Hi,

I am trying to add relational column in my form and able to get all the records in my select box. But I need to get records based in where condition. This is my code. Please suggest on this.

BelongsTo::make('organisation')

What I am expecting is like below.

BelongsTo::make('organisation')->where('organisation_type' '=', '1')

Saikishore left a reply on Undefined Variable: Promo_code

no need to use braces, if you use @if

@if(segment(2) == edit-pdetail ) 
    <input type="hidden" name="edit_promo_code" value="{{$promo_code}}">
        <input type="hidden" name="edit_biller_id" value="{{$biller_id}}">
        <input type="hidden" name="edit_product_id" value="{{$product_id}}">

@endif

Saikishore left a reply on Undefined Variable: Promo_code

If you want to use same template for both Create and update, You need to set condition for some fields.

@if(only for edit) {
   <input type="hidden" name="edit_promo_code" value="{{$promo_code}}">
    <input type="hidden" name="edit_biller_id" value="{{$biller_id}}">
    <input type="hidden" name="edit_product_id" value="{{$product_id}}">
@endif

Saikishore left a reply on Undefined Variable: Promo_code

As per your code there is no promo_code variable from you controller.

18 Sep
7 months ago

Saikishore left a reply on Autoload Error

possible duplicate... you may find solution for this.. https://laracasts.com/discuss/channels/laravel/autoloadphp-fail

07 Sep
7 months ago

Saikishore left a reply on Autoload.php Fail

try this composer dump-autoload

Saikishore left a reply on Redirect With Data

try this in blade...

{{ session()->get( 'id' ) }}

Saikishore left a reply on Autoload.php Fail

did you update composer after pull the code ? composer update

Saikishore left a reply on Redirect With Data

return redirect()->route( 'home' )->with( [ 'variable' => $variableName ] );

31 Aug
7 months ago

Saikishore left a reply on Role, Permissions Attachment Issue

It looks like it has been fixed in latest version. Please give me some time and If it works I will close this.

Saikishore started a new conversation Role, Permissions Attachment Issue

Hi Team,

I am having Roles, Permissions with relation "role_permission" pivot table with ManyToMany relation.

I am trying to attach new permission to role from Role View page. But I am not getting permissions in select box. Also getting error as

Trying to get property 'resourceClass' of non-object

in nova/src/Http/Controllers/AttachableController.php

Please check my Fields code in Role Resource.

public function fields(Request $request)
    {
        return [
            ID::make()->sortable(),
            Text::make('Name')->sortable()->rules('required', 'max:255'),
            BelongsToMany::make('permission')
        ];
    }

10 Aug
8 months ago

Saikishore left a reply on How To Use Format('d-m-Y') In Ajax Return Laravel

You can try this one..

{{ \Carbon\Carbon::parse($ex->date)->format('d-m-Y')}}

or In your Model set:

protected $dates = ['name_field'];

after in your view :

{{ $ex->date->format('d-m-Y'') }}

Saikishore left a reply on Laravel Search Delete

you can add one more route only for delete just before the resource route...as @v0sn mentioned above.

Saikishore left a reply on Filter Data From DB.

ooh... May be we need to change the query. I am not sure about it will work or not..

 $join->on('m1.id', '=', 'm2.id')
            ->where('m2.email', 'NOT LIKE', '%m1.firstname%')
            ->orWhere('m2.email', 'NOT LIKE', '%m1.lastname%');

Saikishore left a reply on Filter Data From DB.

What your getting from Query. can you test this once ..

            $join->on('m1.id', '=', 'm2.id')
            ->where('m2.email', 'NOT LIKE', '%m1.firstname%')
            ->where('m2.email', 'NOT LIKE', '%m1.lastname%');
        })->get();

dd($emails);

Saikishore left a reply on Filter Data From DB.

You can find the error easily if you are trying to figure out the error

DB::table('personal_data as p1')

Saikishore left a reply on Wysiwyg Editor With File Manager

You can try this... I don't we can post urls here...

https://github.com/UniSharp/laravel-filemanager

Saikishore left a reply on Fetching All Data.

Try this

return view('projects.show', compact("project"));

Saikishore left a reply on Fetching All Data.

try this once..

return view('projects.show')->with(compact('project'));

Saikishore left a reply on Filter Data From DB.

I didn't test the below code... you can try this and you can manipulate if there are any error..

DB::table('personal_data' as  p1)
        ->join('personal_data as p2', function($join)
        {
            $join->on('p1.id', '=', 'p2.id')
                 ->where('p2.email', 'NOT LIKE', '%p1.first_name%')
        ->where('p2.email', 'NOT LIKE', '%p1.last_name%');
        })
        ->get();

Saikishore left a reply on Fetching All Data.

debug step by step...

dd($project)

if it returns values.. then try belo after @foreach ```dd($pro)``

Saikishore left a reply on Fetching All Data.

Try this

@extends('layouts.app')

@section('content')
    <div class="container">
        <a href="{{ url('/projects') }}" class="btn btn-sm btn-dark">Go Back</a>
        <br>
        <br>
        <table class="table table-hover table-bordered">
            <thead class="thead-dark"> 
                <tr>
                    <th>Name</th>
                    <th>Handle</th>
                    <th>Category</th>
                    <th>Status</th>
                    <th>Privacy Status</th>
                    <th>Created By</th>
                    <th>Created At</th>
                    <th>Updated At</th>
                </tr>
            </thead>    
            
            <tbody>
@foreach($project as $pro)
                <tr>
                    <td>{{ $pro->name }}</td>
                    <td>{{ $pro->handle }}</td>
                    <td>{{ $pro->category }}</td>
                    <td>{{ $pro->status }}</td>
                    <td>{{ $pro->privacy_status }}</td>
                    <td>{{ $pro->created_by }}</td>
                    <td>{{ $pro->created_at }}</td>
                    <td>{{ $pro->updated_at }}</td>
                </tr>

@endforeach
            </tbody>
        </table>
    </div>
@endsection

Saikishore left a reply on Fetching All Data.

Actually we will get multiple records if we use get() method. So we have to use foreach

Saikishore left a reply on Trying To Get Property 'name' Of Non-object

Check the result for these two..

dd($user); dd($user->twitter

Saikishore left a reply on Fetching All Data.

What you are getting when you print this dd($project);

Saikishore left a reply on Filter Data From DB.

Hi @ziben69,

Please correct me if I am wrong. I am understanding that you want to display all the emails not like either firstname or last name. Then, you have to this filtering Query itself by using subquery(self join).

Saikishore left a reply on How To Get Last Id In Laravel?

If you are feeling that multiple Users will submit activities at a time, and if you want send the latest activity then use the below after saving the activity.

$lastActivity = Activity::latest()->first();
return response()->json(['data_activity' =>$lastActivity]);

Saikishore left a reply on How To Get Last Id In Laravel?

Hi @irankhosravi

why are you sending request back again. You can send the saved object which contains activity id also.

return response()->json(['data_activity' =>$activity]);

Saikishore left a reply on 403 Forbidden In Laravel Project In Cpanel

Hi @anandmainali5

As per my understanding, you are trying to access root folder instead of public folder in server.

Saikishore left a reply on Problem With Mix

@p0t4t0 ,

Can you try this once mix.babel() instead of mix.js().

I am not sure . just try this once.

Saikishore left a reply on 403 Forbidden In Laravel Project In Cpanel

@anandmainali5 , Can you check the Storage/logs folder for Clear error. It will help you to figure out exact problem.

Also check your domain exactly mapping to Public folder.

09 Aug
8 months ago

Saikishore left a reply on How To Update All Record On Eloquent?

Hi @MohammadAsadi ,

we can use Mass update in Laravel Eloquent. You can see the laravel ref below..

https://laravel.com/docs/5.3/eloquent#updates

08 Aug
8 months ago

Saikishore left a reply on Need Help With Eloquent Query

@ChanningD

Try to use DB::getQueryLog();

It will give some idea about where it is going wrong.

15 Dec
1 year ago

Saikishore left a reply on Show Image From Other Disk In Filesystems.php

@pascal83 ,

Correct me if my understanding is wrong.

We can not return the images in Controller. We have to send this path to view file and there we can give that path in IMG tag,

 $url = Storage::disk('img')->get($filename);

    return view('yourviewnamehere', ['myFile' => $url ]);

Saikishore left a reply on Required_if Not Working

@almost_pitt ,

I thought we need to use "required_if_attribute" instead of "required_if". also you are using '=='. If we want 2 ore more, we must use ">=2".

Thats my assumption. I didn't tested..

Saikishore left a reply on Required_if Not Working

$rules = array(
    'Number_of_Bedrooms' => 'required',
    'Furnished_2' => 'Number_of_Bedrooms,>=,2
);

Saikishore left a reply on Laravel - Get Specific Array In JSON Encoded Database Column

Try with this... I didn't tested...

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

14 Dec
1 year ago

Saikishore left a reply on WP - Not Saving All Of The Fields When Saving Data To Ninja Forms Plugin

Check your laravel model.... Set all fields are fillable.. this is just my guess

protected $fillable = [ 'name', 'contact', 'email' ];

Saikishore left a reply on Postman Patch Request

@Snapey ,

So we have to send extra parameter in Postman as like sending new param in form.

 <input type="hidden" name="_method" value="PUT">

In postman, we need to send new parameter.

_method => PUT

Am I correct?

Saikishore left a reply on Help On Radio Buttons (ifChecked)

Reset the Radio button group in pageload.

$('input[name="radiobuttomGroup"]').prop('checked', false);

Saikishore left a reply on Value = Null

You must check weather $pages are set or not... use this..

@if(isset($pages2->pages_title) && ($pages2->pages_title != ''))

Saikishore left a reply on Value = Null

@tisuchi ,

Empty checks if the variable is set and if it is it checks it for null, "", 0, etc

Sorry for asking question without trying..

Saikishore left a reply on Value = Null

@tisuchi ,

Please correct me if I am wrong.

If there are no pages, then $pages2->pages_title will not be there right?

!empty will handle this without throwing the error? I didn't test this. just for clarification.

Saikishore left a reply on Postman Patch Request

@shaqaruden ,

Can you share you postman script and route.

Saikishore left a reply on Value = Null

We have another option, if we have pages_title is there with null value,

{{ $pages2->pages_title  or 'Please insert a new page.'}}