Arkhokhar

Arkhokhar

Member Since 3 Years Ago

Experience Points
1,280
Total
Experience

3,720 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
0
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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,280 XP
Sep
21
7 hours ago
Activity icon

Started a new Conversation Conditional Statemnt With In Return Statement?

Hi, as heading suggested i want to know if its possible to add condition with in return statement? like in below code:

return [
       	 'id' => $this->id,
       	 'name' => $this->name, // return only name if $this->id == 1
         'email' => $this->email,  // return only email if $this->id == 2
	]
Jun
25
2 months ago
Activity icon

Replied to Define New Route From Controller

On shared hosting.. Can't edit httpd.config

Activity icon

Replied to Define New Route From Controller

The thing is he want to do that himself.. From front end..

Activity icon

Replied to Define New Route From Controller

Mistakenly selected best answer. It's not solved still

Activity icon

Replied to Define New Route From Controller

But it just do it from author site.. But I need a form in my project plus client will use that form oftenly and I don't think it's OK to just let non experienced person access htaccess.

Activity icon

Replied to Define New Route From Controller

Yes actually my client want to move a website. And he want a form in which he will have 2 input fields 1 for old url(which need to be redirected to new url) and 2nd input field for new url(to which old url must b redirected)..

Activity icon

Started a new Conversation Define New Route From Controller

HI, I want to ask is it possible to define/register new route from inside controller? THANKS

Activity icon

Started a new Conversation Redirect Old Url To New Url

Hi, i want to assign or redirect old URL(routes) to new URL from outside of laravel application.. like i want to make a UI in which user enter old url and new URL for redirect..

May
12
4 months ago
Activity icon

Started a new Conversation Eloquest Saving Wrong Model

i have problem in my code

	$timeslot = new timeslot; 
	$timeslot->service_id = $request->service_id;

	foreach ($request->timeslot as $key => $slot)
{

		foreach ($slot as $time)
		{
			$check = new time;
			$check->from = $time['from'];
			$check->to = $time['to'];
			$check->save();   //error is due to this line. it tries to save timeslot model instead of time model
			$time_id[] = $check->id;
		}

		if($key=='mon')
		{
			$time_id = implode(',',$time_id);
 			$timeslot->mon = $time_id;
 			$time_id= [];
		}
		if($key=='tue')
		{
			$time_id = implode(',',$time_id);
 			$timeslot->tue = $time_id;
 			$time_id= [];
		}
		if($key=='wed')
		{
			$time_id = implode(',',$time_id);
 			$timeslot->wed = $time_id;
 			$time_id= [];
		}
		if($key=='thur')
		{
			$time_id = implode(',',$time_id);
 			$timeslot->thur = $time_id;
 			$time_id= [];
		}
		if($key=='fri')
		{
			$time_id = implode(',',$time_id);
 			$timeslot->fri = $time_id;
 			$time_id= [];
		}
		if($key=='sat')
		{
			$time_id = implode(',',$time_id);
 			$timeslot->mon = $time_id;
 			$time_id= [];
		}
		if($key=='sun')
		{
			$time_id = implode(',',$time_id);
 			$timeslot->sun = $time_id;
 			$time_id= [];
		}
}

$timeslot->save();

the error i receive:

	Illuminate\Database\QueryException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'from' in 'field list' (SQL: insert into `timeslots` (`from`, `to`, `updated_at`, `created_at`) values (6am, 8am, 2020-05-12 08:45:17, 2020-05-12 08:45:17))
May
10
4 months ago
Activity icon

Awarded Best Reply on Incoming Mail Recieved In Sub-domain Not In Main-domain Email Account

i figured out the problem. it was in cpanel > Email Routing > select domain from dropdown > select "Local Mail Exchanger ".

and now i can receive emails in my main domain inbox.

Activity icon

Replied to Incoming Mail Recieved In Sub-domain Not In Main-domain Email Account

i figured out the problem. it was in cpanel > Email Routing > select domain from dropdown > select "Local Mail Exchanger ".

and now i can receive emails in my main domain inbox.

May
09
4 months ago
Activity icon

Replied to Incoming Mail Recieved In Sub-domain Not In Main-domain Email Account

Hi snapey. i am using roundcube for mail on panel.

May
07
4 months ago
Activity icon

Started a new Conversation Incoming Mail Recieved In Sub-domain Not In Main-domain Email Account

I have a La-ravel project and trying to send mail to my email account on C panel. The problem is when I send mail to main domain '[email protected]', I don't receive it in inbox but when I send mail to subdomain '[email protected]', I receive my mail in inbox. I want my mail in main domain inbox not sub-domain inbox.

Apr
22
4 months ago
Activity icon

Started a new Conversation Get Peak Time Of Data Insertion

I want to know the peak time of last day when my Database table received max number of records. Actually i want to know the peak time when user will interact with my Db the most. If it is possible anyway. Thankyou

Apr
16
5 months ago
Activity icon

Replied to Resorce File Returning Array As Object

Cant thankyou both enough.. got solved it by using either of them. \o/

Activity icon

Started a new Conversation Resorce File Returning Array As Object

i am trying to get array of order items with sub_menu array inside order items array using laravel resource file.. but it is returning sub_menu as an object not array.

This is Order item resource file return string

 return [
                            'item_id' => $this->item_id,   
                            'item_name' => $this->item_name,
                            'item_price' => '$'.$this->item_price,
                            'image_url' => $this->item_image_url,
                            'item_quantity' => $this->item_quantity,
                            'item_instruction' => $this->item_instruction,
                            'sub_menu' => $sub_menu,
                          ];

and $sub_menu

$sub_menu =[
                                  'sub_item_id' => $sub_menu->id,
                                   'sub_item_name' => $sub_menu->sub_item_name,
                                 'sub_item_price' => '$'.$sub_menu->sub_item_price,
                                          ];

and OUTPUT is

data:[ 
		{
        "item_id": "2",
        "item_name": "some price",
        "item_price": "$some price",
        "image_url": "some url here",
        "item_quantity": "1",
        "item_instruction": "not chilled",
        "sub_menu": {
            "sub_item_id": 1,
            "sub_item_name": "some name",
            "sub_item_price": "$some price"
        }
    }
			]

what output i want

data:[ 
		{
        "item_id": "2",
        "item_name": "some name",
        "item_price": "$some price",
        "image_url": "some url here",
        "item_quantity": "1",
        "item_instruction": "not chilled",
        "sub_menu": [		//see it is array here with [] brackets, not object 
            "sub_item_id": 1,
            "sub_item_name": "some name",
            "sub_item_price": ".50"
        ]
    }
			]
Apr
06
5 months ago
Activity icon

Replied to Problem Displaying Data From Json Collection

solved it by doing $orders = json_decode(json_encode($orders,true),true);

Thankyou for the time :)

Activity icon

Replied to Problem Displaying Data From Json Collection

doesn't work.. it fails at inner foreach condition error says: Invalid argument supplied for foreach()

Activity icon

Started a new Conversation Problem Displaying Data From Json Collection

i want to show order_items and sub_menu but i cant figure out the way to show them on my view using blade template.

$data->deliver_type; etc works but $data->order_items->item_name; dont work and $data->order_items[item_name]; dont work

below is a picture of json collection that i receive

https://i.ibb.co/HqQznZh/json.jpg