munazzil

munazzil

Member Since 1 Year Ago

Colombo

Trainee Software Developer at multiblity.com

Experience Points 28,330
Experience Level 6

1,670 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 24
Lessons
Completed
Best Reply Awards 24
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.

24 May
2 days ago

munazzil left a reply on Returning Model Based On A Field In Db

you have to pass both parameter and can get the correct receipt type as like below in your function,

     public function show(Receipt $receipt,ReturnReceipt  $returnrecepit) {

        $quantity1 = $receipt->quantity; //always return the value of Receipt model
         $quantity2 = $returnrecepit->quantity;//Second one

         // HOW TO GET THE RIGHT QUANTITY VALUE DEPENDING ON RECEIPT TYPE
    }

Just check with dd() and if you need the correct one you can us a if condition in this query and that will display.

22 May
4 days ago

munazzil left a reply on Laravel 5.8 Foreign Key Not Working

I mean you have to use as like below,

Schema::create('a', function (Blueprint $table) {
        $table->bigInteger('id');
        ....
    });
        
Schema::create('a_i', function (Blueprint $table) {
        $table->bigInteger('id');
        $table->bigInteger('a_id')->unsigned();
        ...
        $table->foreign('a_id')
            ->references('id')->on('a');
    });

munazzil left a reply on Laravel 5.8 Foreign Key Not Working

You can set as like below in your model,

     public $incrementing = false;

munazzil left a reply on Laravel 5.8 Foreign Key Not Working

@snowfox.sk Have you got that worked?

munazzil left a reply on Laravel 5.8 Foreign Key Not Working

Other one is data type should be same for both bigIncrements,

      $table->bigIncrements('a_id')->unsigned();

munazzil left a reply on Laravel 5.8 Foreign Key Not Working

Check the order of table migration first you have to run schema A and the you have to run schema B.

munazzil left a reply on Laravel 5.8 Foreign Key Not Working

You have to assign primary key,

$table->bigIncrements('id')->primary();

21 May
5 days ago

munazzil left a reply on When I Change The Quantity Of My Items, The Total Doesn't Update (PHP)

Something like below,

public static function getTotalPriceExclVAT() { $shoppingCartItems = self:: getShoppingCartItems();

        $somOfProducts = 0;

        foreach ($shoppingCartItems as $shoppingCartItem) {
            $somOfProducts += $shoppingCartItem->getTotalPriceExclVAT();
        }
        
 })

return getTotalPriceExclVAT();

munazzil left a reply on When I Change The Quantity Of My Items, The Total Doesn't Update (PHP)

Your just returning return $somOfProducts; in every function,You have to return every function to get the functions functionality for example,

       return getTotalPriceExclVAT();

munazzil left a reply on Migration Error

Try with below command

   php artisan migrate:refresh

munazzil left a reply on Page Not Found - Except Route Proplem

Can you check below code in CMD?

php artisan route:list

munazzil left a reply on Page Not Found - Except Route Proplem

Can you try below command in CMD and display the result?

 php artisan route:list
20 May
6 days ago

munazzil left a reply on Issues With Sending An Email With A Pdf Attachment

You have to use as like below remove the first() and add get() because that will give only first data not a collection otherwise you can't use loop and foreach function,

      foreach($orders as $order)
    {
        $exists = Order::find($order->id)->where('user_id', $user_id)->latest()->get();
17 May
1 week ago

munazzil left a reply on Logout In Laravel Not Working

Use below one and check it shows the error use it on above blade,

 @if ($message = Session::get('error'))
    <div class="alert alert-success">
        <p>{{ $message }}</p>
    </div>
@endif

munazzil left a reply on Undefined Variable: _ENV Error

@deekshith Welcome Great to hear that you got solution.

munazzil left a reply on I Can't Access Header In Controller Construct

@devfrey Ok could please mind your own business.

munazzil left a reply on Undefined Variable: _ENV Error

Then try,

php artisan cache:clear
php artisan view:clear
php artisan config:clear

munazzil left a reply on Undefined Variable: _ENV Error

Please try with below one,

 php artisan config:cache

munazzil left a reply on Undefined Variable: _ENV Error

Use as like below and check because it get every error,

    @if ($message = Session::get('error'))
       <div class="alert alert-success">
        <p>{{ $message }}</p>
       </div>
    @endif

munazzil left a reply on I Can't Access Header In Controller Construct

In this case your getting first data only using first() because Auth::id would be something different than first data$this->user = User::where('id', Auth::id())->first(); try instead with below one because it getting every data which you have in database using get(),

   $this->user = User::where('id', Auth::id())->get();
16 May
1 week ago

munazzil left a reply on Nova Actionable_id Cannot Be Null

sorry for misleading @devfrey and @agilasadi .

munazzil left a reply on Nova Actionable_id Cannot Be Null

If your using $table->timestamps() then no need to add below tables and remove it,

         $table->string('created_by');
        $table->string('updated_by')->nullable();

munazzil left a reply on Upload Image Not Saved At Directory On Server Laravel 5.8

You have simply use as like below because you haven't assign the data to image use as like below and check,

  {   $file = $request->file('image');
        $name=$file->getClientOriginalName();
        $file->move(public_path().'/files/', $name);  
        $data['image'] = $name;  
    }

and you haven't save the data

$user->save($data);

munazzil left a reply on How To Update A Product In Laravel 5,8

@IRANKHOSRAVI - Yes because it will get the correct image for delete .if it is working or have you try with new one else want to try alternative solution.

munazzil left a reply on How To Update A Product In Laravel 5,8

I have updated with some code check with this,before you have to upload the new image you have to delete old image as like below and use $request->hasfile and use use File in top of your controller,

use File;

  if($request->hasfile('image')) {
    $path = public_path('images/products'),$filename->image;
    File::delete($path);
    $image = $request->file('image');
    $filename = $image->getClientOriginalName();
    $image->move(public_path('images/products'), $filename);
    $product->image = $request->file('image')->getClientOriginalName();
}

munazzil left a reply on Assign A 0 To A Null Value In A Request Array

@zaster

Just use as like below in your migration table and check,

 $table->bigInteger('qty')->unsigned()->default('0');

else Put the default value in single quote and it will work,

$table->integer('qty')->default('0');
15 May
1 week ago

munazzil left a reply on Data Not Saving In Database Table In Real

@devfrey. As per my personnel wish using $guarded because laravel has provided that feature then we have to use it.

munazzil left a reply on Data Not Saving In Database Table In Real

Then just use below one and check,

 protected $guarded = [];

munazzil left a reply on User Data Isn't Showing Form Db And Not Giving Any Error

Have you run below command after edit form in your CMD,

npm run dev

munazzil left a reply on Feature Tests Do Not Work (404)

.env.testing in your file don't have a key run below command in your CMD,

   php artisan key:generate

munazzil left a reply on Data Not Saving In Database Table In Real

After this save() and check dd($users) instead of var_dump($users);,

 $users = User::create([
            'first_name'     => $row[1],
            'middle_name'    => $row[2],
            'last_name' => $row[3],
            'email' => $row[4],
            'role_id' => 6,//$row[5],
            'telephone' => $row[6],
            'mobile' => $row[7],

        ]);

   $user->save();//check

munazzil left a reply on Auth Data Empty

Use as like below top of you controller,

public function __construct()
{
    $this->middleware('auth');
    
 }

and change as like below,

public function pin_view(User $user) { $id = \Auth::id(); $pin=$user; return view('otp',compact('pin')); }

14 May
1 week ago

munazzil left a reply on SQLSTATE[23000]: Integrity Constraint Violation: 1048 Column 'product_id' Cannot Be Null (SQL: Insert Into `category_product`

Sorry you have missing the save() in end of your function after the image.

public function store(ProductRequest $request)
{
$product = new Product();
$product->user_id = auth()->user()->id;
$product->title = $request->title;
$product->body = $request->body;
$product->price = $request->price;
$product->categories()->attach($request->category);
$image = $request->image;
$filename = $image->getClientOriginalName();
$image->move(public_path('images/products'), $filename);
$product->image = $image;
$product->save();//just add this and check
return redirect()->route('products.index');
 }

munazzil left a reply on "Header May Not Contain More Than A Single Header, New Line Detected" After User Is Login

In your @extends('layouts.site') there are another path also as like this in your view@extends('layouts.app') Post your layouts.site as well.

munazzil left a reply on SQLSTATE[23000]: Integrity Constraint Violation: 1048 Column 'product_id' Cannot Be Null (SQL: Insert Into `category_product`

You have to change the relationship,

public function categories() { return $this->hasMany(Category::class); }

13 May
1 week ago

munazzil left a reply on Pagination Not Working After Posting A Value To Controller And Gets Back

That error because of your routes check with below command in your CMD?and change your web.php file.else post here your files?

php artisan route:list

munazzil left a reply on "Header May Not Contain More Than A Single Header, New Line Detected" After User Is Login

I think error in admin.auth.login' because this error came you have used @extends() or @yield(),It may caused this problem check the blade.php files.

munazzil left a reply on Pagination Not Working After Posting A Value To Controller And Gets Back

You have to change this line return \View::make('admin.Assign-Vendor')->with(compact('orders','users','success')); as like below

         return view('admin.Assign-Vendor',compact('orders','users','success'));

munazzil left a reply on Collection Array Add Key And Value

Use as like below and check.

       $Jobs = Job::all()->toArray();

@foreach($jobs as $key=> $value)
{{$value}}
 @endforeach

munazzil left a reply on Where Can We Get A Free Php Mail Newsletter Templates?

Thank you @bobbybouwmann , with that can I use php mail() function as well?

munazzil started a new conversation Where Can We Get A Free Php Mail Newsletter Templates?

Can you guys provide php mail newsletter else can you suggest any url to implement phpmailer?

10 May
2 weeks ago

munazzil left a reply on Foreach Blade Return Only One Row - Laravel

Check your controller function with dd($tag) and display the result ,

else use as like below with toArray(),

        $tag = Product::get()->toArray();

munazzil left a reply on Method Illuminate\Support\Collection::paginate Does Not Exist

Then it is suggest that that is not a collection can you dd($doctor) and check and also can change it to an array,

$doctor = Auth::user()->meeting()->get()->toArray()->paginate(2);

munazzil left a reply on Method Illuminate\Support\Collection::paginate Does Not Exist

You can use in the index function as like below as you have to pass the $doctor and $monday in compact funtion,

return view('user.view',compact('doctor','monday'));

and your index.blade.php,

    {{ $monday->Links() }}
09 May
2 weeks ago

munazzil left a reply on Deploying Laravel App On Cpanel Is Returning Symfony/polyfill-mbstring/bootstrap.php

error in your php version upgrade that and check while check below as well,

https://laravel.com/docs/5.8

Options +FollowSymLinks -Indexes RewriteEngine On

RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L]

munazzil left a reply on Insert Selected Id Into Another Table

Then use first one with below one in top of your controller,

  use Auth;