atmaboy

atmaboy

Member Since 11 Months Ago

Experience Points 990
Experience Level 1

4,010 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 0
Lessons
Completed
Best Reply Awards 1
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.

08 May
1 month ago

atmaboy left a reply on How To Only Return Collections Where No Other Relationship

Solution is

Task.php

    public function join()
    {
        return $this->hasOne('App\Join','task_id');
    }

TaskController.php

 $user = auth::user();
 $query->where('user_id', '!=', Auth::id())
                ->WhereDoesntHave('join', function (Builder $query) use($user){
                $query->where('user_id', 'like', $user->id);
            });
06 May
1 month ago

atmaboy left a reply on How To Only Return Collections Where No Other Relationship

@SNAPEY - current_status always zero yes, i using this for my view template...

i don't understand how to make query right

how return

task != auth user and if join has no record with this task_id and not by auth user

maybe i can use something like that, but it not working...

$query->WhereHas('joined','===','null')->paginate(30);

atmaboy left a reply on How To Only Return Collections Where No Other Relationship

return $query->with(['joined' => function ($query) {
                    return $query
                    ->with(['user_join']);
                }]);

like that i get joined users, but i can't understand how use this relationship with where and not equal auth->user->id

atmaboy left a reply on How To Only Return Collections Where No Other Relationship

also i do something like this in model

Task.php

    public function joined()
    {
        return $this->hasManyThrough('App\Join', 'App\Task', 'id', 'task_id', 'id', 'id');
    }

Join.php

    public function user_join()
    {
        return $this->belongsTo('App\User', 'user_id', 'id');
    }

can i return query task where joined() has not auth user ?

atmaboy left a reply on How To Only Return Collections Where No Other Relationship

I thought that it could just check attributes. because it relation with auth->user->id

atmaboy left a reply on How To Only Return Collections Where No Other Relationship

@SNAPEY - app Task.php

protected $attributes = ['current_status' => 0];

atmaboy left a reply on How To Only Return Collections Where No Other Relationship

@PALAK27 - i need query and where in relationship with other model join

i have model task and join when user join it record (task_id,user_id) need return free to join tasks

atmaboy left a reply on How To Only Return Collections Where No Other Relationship

@SNAPEY - i need return tasks where owned by someone else, and user not join...

i can't do where ('current_status') because this attribute is empty when i get tasks

i make

           foreach($q as $task) {
           $status = Join::where('user_id',$user->id)->where('task_id',$task->id)->first();
           if($status['user_id'] == $user->id){
               $task->current_status = false;
           }
           else{
               $task->current_status = true;
           }

then attribute is true or false...

05 May
1 month ago

atmaboy left a reply on How To Only Return Collections Where No Other Relationship

@MUSHOOD - thx, but i need return tasks not join, only need check if it null there...

atmaboy left a reply on How To Only Return Collections Where No Other Relationship

where auth user_id != task user_id and where null in join model with user_id

atmaboy left a reply on How To Only Return Collections Where No Other Relationship

@SNAPEY - yes where null in Join model and where task not equal auth user->id

atmaboy left a reply on How To Only Return Collections Where No Other Relationship

@SNAPEY - i need return where task is not belongs to user and where no record in other model Join, how?

atmaboy started a new conversation How To Only Return Collections Where No Other Relationship

    use App\User;
    use App\Task;
    use App\Join;
    
    public function tasks(Request $request)
    {
        $user = auth::user();
            $query = Task::query();

        $query->with('User')->with('task_type');
        $q = $query->paginate($tasksPerPage);
        
           foreach($q as $task) {
           $status = Join::where('user_id',$user->id)->where('task_id',$task->id)->first();
           if($status['user_id'] == $user->id){
               $task->current_status = false;
           }
           else{
               $task->current_status = true;
           }
        }
        return $q;
        

How return only task where not found record in other relation Join model ?

or return only records with current_status true and pagination

25 Feb
4 months ago

atmaboy left a reply on Change Data Between Few Router-view

This happens because your function doesn't know what this is, you should explicitly tell it to use your component:

mounted() {
  this.$root.$on(
    'switch-mode', 
    (function (EventGrid) { ... }).bind(this)
  )
}

Or, more effectively and modern, use an arrow function:

mounted() {
  this.$root.$on('switch-mode', (EventGrid) => { ... })
}

atmaboy left a reply on Change Data Between Few Router-view

[Vue warn]: Error in event handler for "switch-mode": "TypeError: this.filter is undefined"

atmaboy started a new conversation Change Data Between Few Router-view

I have two <router-view> components, and can't pass data from one to another component

at first router-view have

        data() {
            return {
                mode: true,
            }
        },
<input type="checkbox" class="switch-mode" v-model="mode" @change="$root.$emit('switch-mode', mode)">

and other is

            data() {
            return {
                filter: {
                    mode: false,
                    order: 'DESC'
                },
            }
        },
        mounted() {
        this.$root.$on('switch-mode', function (EventGrid) {
        console.log('Grid mode is '+EventGrid); //this works it return true,false
        this.filter.mode = EventGrid; // not working this.filter is undefined"
            })
        },
18 Oct
8 months ago

atmaboy left a reply on Laravel Nova Action Fields

    public function handle(ActionFields $fields, Collection $models)
    {
            foreach ($models as $model) {
            $model->status_page_id = $fields->id;
            $model->save();
        }
    return Action::message('Selected page status was changed!');
    }

    /**
     * Get the fields available on the action.
     *
     * @return array
     */
    public function fields()
    {
  $statuses = \App\Page_status::all()->pluck('name','id');
  return [
     Select::make('Status','id')->options($statuses)
    ];
    }

atmaboy left a reply on Laravel Nova Action Fields

Yes you need make fields, and run it

foo bar

15 Oct
8 months ago

atmaboy left a reply on How To Change Nova Action Select Name To My Own Word?

which name select you want to change ?

you can add this to your action file public function name() { return $this->name ?: 'My action name'; }

18 Sep
9 months ago

atmaboy started a new conversation Nova Avatar Right Top How Change It ?

alt text

i change nova/resources/views/partials/user.blade.php

<dropdown-trigger class="h-9 flex items-center" slot-scope="{toggle}" :handle-click="toggle">
    <img src="/storage/{{auth()->user()->avatar}}?size=512" class="rounded-full w-8 h-8 mr-3"/>

    <span class="text-90">
        {{ auth()->user()->name }}
    </span>
</dropdown-trigger>

<dropdown-menu slot="menu" width="200" direction="rtl">
    <ul class="list-reset">
        <li>
            <a href="{{ route('nova.logout') }}" class="block no-underline text-90 hover:bg-30 p-3">
                {{ __('Logout') }}
            </a>
        </li>
    </ul>
</dropdown-menu>

but this not working, it gavatar like was before

16 Sep
9 months ago

atmaboy left a reply on Storing Payments - Database Perfomance Help

this is virtual payments inside system... so actully thinking, how better optimise this developing....

15 Sep
9 months ago

atmaboy left a reply on Storing Payments - Database Perfomance Help

@Snapey

The first question is, is it necessary to encrypt the data for protection? How best to organize the structure?

I will have approximately 1000 entries Per Daily Active User

atmaboy started a new conversation Storing Payments - Database Perfomance Help

Prompt knowing people who have experience. How best to store payments. Will there be a heavy load on the database?

Tell me how best to make a database structure for storing payments?

15 Jul
11 months ago

atmaboy started a new conversation Laravel 5.4 Messaging Logout

How make message after logout

i use default LoginController.php

public function authenticated(Request $request, $user)
{

    if ($user->confirmed != 1) {

      Auth::logout($request);

       return redirect('/login')->with('session','Message');

    }
    else{

        $request->session()->flash('status', 'You are successful log in!');

    }
}

but it only redirect...

so i need check confirmed email or not, if not confirmed make logout with message...