atmaboy

atmaboy

Member Since 1 Year Ago

Experience Points
1,040
Total
Experience

3,960 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-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
1,040 XP
May
08
5 months ago
Activity icon

Replied to 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);
            });
May
06
5 months ago
Activity icon

Replied to 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 only return tasks of unauthorized user and where there are no records in another table join

maybe like that but it not working...

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

Activity icon

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

Activity icon

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

Activity icon

Replied to How To Only Return Collections Where No Other Relationship

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

Activity icon

Replied to How To Only Return Collections Where No Other Relationship

@SNAPEY - app

this only attribute of model.

Task.php

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

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

Activity icon

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

May
05
5 months ago
Activity icon

Replied to 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 in join...

Activity icon

Replied to How To Only Return Collections Where No Other Relationship

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

Activity icon

Replied to How To Only Return Collections Where No Other Relationship

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

Activity icon

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

Activity icon

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

Feb
25
7 months ago
Activity icon

Replied to 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) => { ... })
}
Activity icon

Replied to Change Data Between Few Router-view

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

Activity icon

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"
            })
        },
Oct
18
1 year ago
Activity icon

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

Replied to Laravel Nova Action Fields

Yes you need make fields, and run it

foo bar

Oct
15
1 year ago
Activity icon

Replied to 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';
    }
Sep
18
1 year ago
Activity icon

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

Sep
16
1 year ago
Activity icon

Replied to Storing Payments - Database Perfomance Help

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

Sep
15
1 year ago
Activity icon

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

Activity icon

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 storingpayments?

database structure

    if(! function_exists('total_budget'))
{
function total_budget($user_id = null)
{
  $budgets = budgets::where('users_id',($user_id))->get();
  //print_r($totalpoints);
  $credits = 0;
  $debits = 0;
  foreach($budgets as $budget)
  {
    $credits += ($budget->credit) ? decrypt($budget->credit): 0;
    $debits += ($budget->debit) ? decrypt($budget->debit): 0;
  }
    $totalcount = ($credits-$debits);
  return $totalcount; 
}
}

Jul
15
1 year ago
Activity icon

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...