rafidAhsan

rafidAhsan

Member Since 3 Months Ago

Experience Points
11,820
Total
Experience

3,180 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
110
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 3
11,820 XP
Sep
27
22 hours ago
Activity icon

Replied to Object Of Class StdClass Could Not Be Converted To String

Thank you so much. I will be happy if you give me a quick knowledge of the problem. why did it happen?

Activity icon

Replied to Object Of Class StdClass Could Not Be Converted To String

array:3 [▼
  0 => "12"
  1 => "12"
  2 => {#1233 ▼
    +"image": "1600930672.png"
  }
]

This is the output of dd($key);

Activity icon

Replied to Object Of Class StdClass Could Not Be Converted To String

Error Object of class stdClass could not be converted to string http://localhost:8000/order_confirm/1

This is the whole Error. There is no line or line number in it

Activity icon

Replied to Object Of Class StdClass Could Not Be Converted To String

Can't understand. What is a detailed log?

Activity icon

Started a new Conversation Object Of Class StdClass Could Not Be Converted To String

Error Object of class stdClass could not be converted to string

Associate Controller

public function create(Request $request) {
        $live_id = Live::orderByDesc('id')->first()->id;
        $prices = $request->price;
        $quantities = $request->quantity;
        $images = DB::table('orders')
            ->select('image')
            ->where('user_id','=',$request->user_id)
            ->where('live_id','=',$live_id)
            ->get()
            ->all();

        $serial = ($request->user_id * $live_id) + 100 + time();
        $invoice_infos = array_map(null, $prices, $quantities, $images);

        foreach($invoice_infos as $info => $key) {
            $invoice = new Invoice();

            $invoice->user_id = $request->user_id;
            $invoice->price = $key[0];
            $invoice->quantity = $key[1];
            $invoice->discount = $request->discount;
            $invoice->total = $key[0] * $key[1];
            $invoice->orderImage = $key[2];
            $invoice->serial = $serial;

            $invoice->save();
        }
        return redirect('/order_delete/'.$request->user_id.'/'.$live_id.'/'.$serial);
    }

Model

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Invoice extends Model
{
    protected $fillable = [
        'image', 'quantity', 'user_id'
    ];

}
Sep
24
3 days ago
Activity icon

Replied to Remove Double Quote

Thank you so so much...

Activity icon

Replied to Remove Double Quote

No I don't have,

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Order extends Model
{
    protected $fillable = [
        'image', 'quantity', 'user_id'
    ];

    protected $casts = [
        'image' => 'array',
        'quantity' => 'array'
    ];

    public function lives() {
        return $this->hasMany(Live::class)->withTimeStamps();
    }
}
Activity icon

Replied to Remove Double Quote

Yeah. It does not have. Just image has double quote

Activity icon

Replied to Remove Double Quote

But on database data has double quotes also.

Activity icon

Replied to Remove Double Quote

@sinnbeck

"1600532044.JPG" This is a data for image column and I am confused too. Istucked here for weeks.

Activity icon

Replied to Remove Double Quote

@automica I am Getting image extensions for $extension variable. But as string. I want to remove double quote from it and $fileName variable..

dd($extension)="png" expected Output = png

dd($fileName) = "yVHlPHOPz1iOCjeCxq0S.png" expected Output = yVHlPHOPz1iOCjeCxq0S.png

Activity icon

Replied to Remove Double Quote

I used

$fileName = str_replace('"', '', $fileName);
$fileName = trim($fileName, '"');

These didn't work.

Activity icon

Replied to Remove Double Quote

No. It doesn't. And the Database has also the double-quotes. This is a major problem.

Activity icon

Replied to Remove Double Quote

I am Getting image extensions for $extension variable. But as string. I want to remove double quote from it and $fileName variable..

dd($extension)="png" expected Output = png

dd($fileName) = "yVHlPHOPz1iOCjeCxq0S.png" expected Output = yVHlPHOPz1iOCjeCxq0S.png

Activity icon

Started a new Conversation Remove Double Quote

I can't remove double quotes form getOriginalExtension(). Can anyone help me?!

public function insert(Request $request) { $images = $request->file('image'); $quantities = $request->quantity;

    $order_infos = array_map(null, $images, $quantities);

    foreach($order_infos as $info => $key) {
        $order = new Order();

        $order->user_id = $request->id;
        $order->quantity = $key[1];

        $extension = $key[0]->getClientOriginalExtension();
        dd($extension);
        $fileName = Str::random(20). '.' .$extension;
        $key[0]->move('storage/images/', $fileName);
        $order->image = $fileName;

        $order->live_id = Live::orderByDesc('id')->first()->id;
        $order->save();
    }
    return redirect('/')->with('status', 'Your order is Done!');
}
Sep
22
5 days ago
Activity icon

Replied to Array To String Conversion::Error Exception

public function insert(Request $request) { $images = $request->file('image'); $quantities = $request->quantity;

    $order_infos = array_map(null, $images, $quantities);

    foreach($order_infos as $info => $key) {
        $order = new Order();

        $order->user_id = $request->id;
        $order->quantity = $key[1];

        $extension = $key[0]->getClientOriginalExtension();
        $fileName = Str::random(20) . '.' .$extension;
        $key[0]->move('storage/images/', $fileName);
        $order->image = $fileName;

        $order->live_id = Live::orderByDesc('id')->first()->id;
        $order->save();
    }
    return redirect('/')->with('status', 'Your order is Done!');
}

When I insert any image here ... It stores as strings on Database.. Example: "imageName" . This is the problem... This is the Controller

Sep
21
6 days ago
Activity icon

Replied to Array To String Conversion::Error Exception

array:3 [▼ 0 => array:3 [▼ 0 => "12" 1 => "12" 2 => array:1 [▼ "image" => ""1600706906.JPG"" ] ] 1 => array:3 [▼ 0 => "12" 1 => "12" 2 => array:1 [▼ "image" => ""yVHlPHOPz1iOCjeCxq0S.png"" ] ] 2 => array:3 [▼ 0 => "12" 1 => "12" 2 => array:1 [▼ "image" => ""3p9ieLKsBXfasvqfX8zk.JPG"" ] ] ]

This is the output of dd($invoice_info)... This should work if I "image" => ""3p9ieLKsBXfasvqfX8zk.JPG"" remove this ""{$imageName}"" double qoute.

Thank you

Sep
20
1 week ago
Activity icon

Started a new Conversation Array To String Conversion::Error Exception

This Block gives me this error.. Can anyone help me please.

public function create(Request $request) { $live_id = Live::orderByDesc('id')->first()->id;

    $prices = $request->price;
    $quantities = $request->quantity;
    $images = DB::table('orders')
        ->select('image')
        ->where('user_id','=',$request->user_id)
        ->get()
        ->all();

    $image = json_decode(json_encode($images),true);

    $serial = ($request->user_id * $live_id) + 100 + time();

    $invoice_infos = array_map(null, $prices, $quantities, $image);

    foreach($invoice_infos as $info => $key) {
        $invoice = new Invoice();

        $invoice->user_id = $request->user_id;
        $invoice->price = $key[0];
        $invoice->quantity = $key[1];
        $invoice->discount = $request->discount;
        $invoice->total = $key[0] * $key[1];
        $invoice->orderImage = $key[2];
        $invoice->serial = $serial;

        $invoice->save();
    }

    return redirect('/order_delete/'.$request->user_id.'/'.$live_id.'/'.$serial);
}
Sep
16
1 week ago
Activity icon

Replied to Image Not Showing ?

I solve that this by trim() function

Sep
13
2 weeks ago
Activity icon

Replied to Laravel Doesn't Show Image

I able to fix the issue after 4 hours. It can be done with trim() function

see this code

<tbody>
                    @foreach ($products_user as $product)
                        <tr>
                            <td>{{$product->name}}</td>
                            <td>{{$product->phone_number}}</td>
                            <td>{{$product->url}}</td>
                            <td>
                                <img src="{{ asset('storage/images/'.trim($product->image, '"')) }}" height="100px" width="100px" alt="">
                            </td>
                            <td>{{$product->quantity}}</td>
                            <td>
                                <div class="row">
                                    <div class="col-md-6">
                                        <a href="/order_confirm/{{ $product->id }}" class="btn btn-primary btn-sm">Confirm</a>
                                    </div>
                                    <div class="col-md-6">
                                        <button type="button" class="btn btn-danger btn-sm" data-toggle="modal" data-target="confirmDeleteModal">Delete</button>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    @endforeach
                </tbody>
Activity icon

Replied to Storage Link Not Loading Image After Symlink

Where I use Illuminate\Support\Facades\Storage; I am having the same problem

Activity icon

Replied to Image Not Showing ?

I have kind of the same problem

<{img} src="{{ asset('uploads/images/' . $product->image) }}" height="100px" width="100px" alt="$product->image">

This is not showing the picture but the out of {{ asset('uploads/images/'.$product->image) }} is

http://localhost:8000/uploads/images/"1599803302.JPG"

I don't know what I'm gonna do. Need help!

Aug
09
1 month ago
Activity icon

Replied to Redirect To Route With Data

$message = 'Your seial is '.rand(1, 100);

return redirect('/')->with('msg', $message);

Jul
31
1 month ago
Activity icon

Commented on Fetch Game Information From The IGDB API

{{ Carbon\Carbon::parse($game['first_release_date'])->format('M Y D')}} This line gives me error about " THIS SYNTAX IS HARMFUL FOR THE FUTURE VERSION OF LARAVEL" Then I use {{ \Carbon\Carbon::parse($game['first_release_date'])->format('M Y D')}}

Activity icon

Commented on Fetch Game Information From The IGDB API

Thank you. I have the same issue here...

Activity icon

Commented on Style A Single Game Page With Tailwind

Thank you so much Sir!

Jun
27
3 months ago
Activity icon

Commented on Automatically Resolve Dependencies

Why I use it actually.....??? 🥴🥴🥴🥴

Jun
20
3 months ago
Activity icon

Commented on Make A Router

I dont know why.. I'm getting same error as always.. can't solve it.. Even if i directly download the github project, it just doesn't work.. Please help

Fatal error: Uncaught Exception: No route defined for this URI. in C:\xampp\htdocs\pdo\core\Router.php:27 Stack trace: #0 C:\xampp\htdocs\pdo\index.php(6): Router->direct('pdo') #1 {main} thrown in C:\xampp\htdocs\pdo\core\Router.php on line 27