virtual

virtual

Member Since 1 Year Ago

Experience Points 890
Experience Level 1

4,110 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 0
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.

11 Sep
5 days ago

virtual started a new conversation Fetch Nested Table Data In Laravel

Hi, I have faced a problem. I am want to fetch data from multiple table.But cuold not do this. Below i am given my elequent relationships. Model- Order

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Order extends Model
{
    protected $guarded=[];
    
    public function orderItems()
    {
        return $this->hasMany(OrderItem::class);
    }
}

model-OrderItem

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class OrderItem extends Model
{
    protected $guarded=[];
    public function products()
    {
        return $this->belongsTo(Product::class);
    }
   
    public function orders()
    {
        return $this->belongsTo(Order::class);
    }
}

Model-Product

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Product extends Model
{
    protected $guarded=[];
    public function user()
    {
        return $this->belongsTo(User::class);
    }
  
  
    public function orderItem()
    {
        return $this->hasMany(OrderItem::class);
    }
  
}

And my controller method

public function completeOrder()
{
  
    $orders  = Order::with(['orderItems','orderItems.products'])->where('user_id',Auth::user()->id)->get();
    return $orders;
     return view('frontEnd.cart.completeOrder',compact('cartItem'));
}

Result---

[{"id":1,"user_id":11,"orderNumber":"#00000012","total":"3,525.94","payment":"ssfs","transaction_id":null,"process":"pending","processed_by":null,"created_at":"2019-09-11 04:50:49","updated_at":"2019-09-11 04:50:49","order_items":[]},{"id":2,"user_id":11,"orderNumber":"#00000012","total":"15,634.41","payment":"ssfs","transaction_id":null,"process":"pending","processed_by":null,"created_at":"2019-09-11 04:54:32","updated_at":"2019-09-11 04:54:32","order_items":[]},{"id":3,"user_id":11,"orderNumber":"#00000012","total":"15,634.41","payment":"ssfs","transaction_id":null,"process":"pending","processed_by":null,"created_at":"2019-09-11 05:00:01","updated_at":"2019-09-11 05:00:01","order_items":[]},{"id":4,"user_id":11,"orderNumber":"#00000012","total":"5,302.22","payment":"ssfs","transaction_id":null,"process":"pending","processed_by":null,"created_at":"2019-09-11 05:04:34","updated_at":"2019-09-11 05:04:34","order_items":[]},{"id":5,"user_id":11,"orderNumber":"#00000012","total":"1,210.00","payment":"ssfs","transaction_id":"978678","process":"pending","processed_by":null,"created_at":"2019-09-11 05:07:00","updated_at":"2019-09-11 05:07:00","order_items":[]},{"id":6,"user_id":11,"orderNumber":"#00000012","total":"2,214.30","payment":"ssfs","transaction_id":null,"process":"pending","processed_by":null,"created_at":"2019-09-11 05:18:04","updated_at":"2019-09-11 05:18:04","order_items":[]},{"id":7,"user_id":11,"orderNumber":"#00000012","total":"2,214.30","payment":"ssfs","transaction_id":null,"process":"pending","processed_by":null,"created_at":"2019-09-11 05:19:53","updated_at":"2019-09-11 05:19:53","order_items":[]},{"id":8,"user_id":11,"orderNumber":"#00000012","total":"4,951.32","payment":"ssfs","transaction_id":null,"process":"pending","processed_by":null,"created_at":"2019-09-11 12:22:51","updated_at":"2019-09-11 12:22:51","order_items":[{"id":12,"order_id":8,"product_id":6,"discount":"12","tax":"859.32","subtotal":"432","quantity":1,"created_at":"2019-09-11 12:22:51","updated_at":"2019-09-11 12:22:51","products":null},{"id":13,"order_id":8,"product_id":7,"discount":"12","tax":"859.32","subtotal":"3660","quantity":2,"created_at":"2019-09-11 12:22:51","updated_at":"2019-09-11 12:22:51","products":null}]},{"id":9,"user_id":11,"orderNumber":"#00000012","total":"866.36","payment":"ssfs","transaction_id":"78965","process":"pending","processed_by":null,"created_at":"2019-09-11 13:17:04","updated_at":"2019-09-11 13:17:04","order_items":[{"id":14,"order_id":9,"product_id":3,"discount":"12","tax":"150.36","subtotal":"284","quantity":1,"created_at":"2019-09-11 13:17:04","updated_at":"2019-09-11 13:17:04","products":null},{"id":15,"order_id":9,"product_id":6,"discount":"12","tax":"150.36","subtotal":"432","quantity":1,"created_at":"2019-09-11 13:17:04","updated_at":"2019-09-11 13:17:04","products":null}]},{"id":10,"user_id":11,"orderNumber":"#00000012","total":"0.00","payment":"ssfs","transaction_id":"78965","process":"pending","processed_by":null,"created_at":"2019-09-11 13:17:58","updated_at":"2019-09-11 13:17:58","order_items":[]},{"id":11,"user_id":11,"orderNumber":"#00000012","total":"0.00","payment":"ssfs","transaction_id":"78965","process":"pending","processed_by":null,"created_at":"2019-09-11 13:19:23","updated_at":"2019-09-11 13:19:23","order_items":[]},{"id":12,"user_id":11,"orderNumber":"#00000012","total":"0.00","payment":"ssfs","transaction_id":"78965","process":"pending","processed_by":null,"created_at":"2019-09-11 13:19:35","updated_at":"2019-09-11 13:19:35","order_items":[]},{"id":13,"user_id":11,"orderNumber":"#00000012","total":"0.00","payment":"ssfs","transaction_id":"78965","process":"pending","processed_by":null,"created_at":"2019-09-11 13:19:43","updated_at":"2019-09-11 13:19:43","order_items":[]},{"id":14,"user_id":11,"orderNumber":"#00000012","total":"2,214.30","payment":"ssfs","transaction_id":"2423","process":"pending","processed_by":null,"created_at":"2019-09-11 14:04:20","updated_at":"2019-09-11 14:04:20","order_items":[{"id":16,"order_id":14,"product_id":7,"discount":"12","tax":"384.30","subtotal":"1830","quantity":1,"created_at":"2019-09-11 14:04:20","updated_at":"2019-09-11 14:04:20","products":null}]}]

I want to fetch all product data but can not do this. How to solve this problem. note in the order table user_id column exist. Thanks in advanced.

01 Sep
2 weeks ago

virtual left a reply on First RowId Not Deleted From The Shopping Cart

@nakov sir, only first item not pass to the controller method. when click the button it is not show confirm messag instead of it generate the below url..

http://localhost/electro_service/user/product/user-account/cart?quantity=1&_token=XPjzGyyykNjE5OAtd3NcQEA3mvpBF8DHH8reESSr&_method=DELETE&quantity=1&name=#

virtual left a reply on First RowId Not Deleted From The Shopping Cart

@nakov sir, Everything works fine, when item add to the cart then the only first item rowid not delted. even delete button not working of first item.Besides the first item, all other items are deleted from the cart successfully. I want to know what's the problem.

virtual left a reply on First RowId Not Deleted From The Shopping Cart

@Snapey sir Yes it is shopping cart packge method.

virtual left a reply on First RowId Not Deleted From The Shopping Cart

@nakov sir I am use resource controller. is the problem arise using resource controller?

virtual started a new conversation First RowId Not Deleted From The Shopping Cart

Hi, I am working in laravel 5.8. In my project I am installing shopping cart API. This works fine but when I am trying to delete items from shopping but only first rowId not deleted from the shopping cart. Besides all of those are deleled form the cart successfully.I don't understand what is the problem. Why don't delete first rowId?. Here is the blade part

<td class="product-remove">
    <form action="{{route('user.cart.destroy',$item->rowId)}}" method="post" onsubmit="return confirm('Are you sure?');">
           @csrf
        @method('DELETE')
       <button><i class="zmdi zmdi-close"></i</button>
                                                                
     </form> 
</td>

Here is the cart controller--

 public function destroy($id)
    {
       // return $id;
        Cart::remove($id);
        return back(); // will keep same page
    }

But when i checked developer console then get below error

GET http://localhost/electro_service/user/product/user-account/'https://fonts.googleapis.com/css?family=Raleway:400,500,600,700|Roboto:400,500,700 net::ERR_ABORTED 404 (Not Found)  cart:18

I don't understood this error. Please anyone help me. Thanks in advanced.

28 Jul
1 month ago

virtual left a reply on Redirector::with Does Not Exist.

@bobbybouwmann ,Yes it is default auth but why show this error message after reset passsword and why not redirect me aspect location such as admin or user panel

virtual left a reply on Redirector::with Does Not Exist.

@bobbybouwmann sir I do not know where change is needed. here is my ResetPasswordController

<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;
use Illuminate\Support\Facades\Auth;

class ResetPasswordController extends Controller
{ 
    use ResetsPasswords;
    protected $redirectTo;
    public function __construct()
    {
        if (Auth::check() && ((!empty(Auth::user()->role->role) == 0)||(!empty(Auth::user()->role->role) == 1)||(!empty(Auth::user()->role->role) == 2))&&Auth::user()->role_id !=NULL) {
            $this->redirectTo=route('admin.dashboard');
        }else{
             $this->redirectTo='/';
        }
        $this->middleware('guest');
    }
}

And some part of traits (ResetsPasswords)

use RedirectsUsers;

    public function showResetForm(Request $request, $token = null)
    {
        return view('auth.passwords.reset')->with(
            ['token' => $token, 'email' => $request->email]
        );
    }

  
    public function reset(Request $request)
    {
        $request->validate($this->rules(), $this->validationErrorMessages());

        $response = $this->broker()->reset(
            $this->credentials($request), function ($user, $password) {
                $this->resetPassword($user, $password);
            }
        );

        return $response == Password::PASSWORD_RESET
                    ? $this->sendResetResponse($request, $response)
                    : $this->sendResetFailedResponse($request, $response);
    }

    
    protected function rules()
    {
        return [
            'token' => 'required',
            'email' => 'required|email',
            'password' => 'required|confirmed|min:8',
        ];
    }

    /**
     * Get the password reset validation error messages.
     *
     * @return array
     */
    protected function validationErrorMessages()
    {
        return [];
    }

    /**
     * Get the password reset credentials from the request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    protected function credentials(Request $request)
    {
        return $request->only(
            'email', 'password', 'password_confirmation', 'token'
        );
    }

    /**
     * Reset the given user's password.
     *
     * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
     * @param  string  $password
     * @return void
     */
    protected function resetPassword($user, $password)
    {
        $user->password = Hash::make($password);

        $user->setRememberToken(Str::random(60));

        $user->save();

        event(new PasswordReset($user));

        $this->guard()->login($user);
    }

    /**
     * Get the response for a successful password reset.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  string  $response
     * @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
     */
    protected function sendResetResponse(Request $request, $response)
    {
        return redirect($this->redirectPath())
                            ->with('status', trans($response));
    }

Sir please tell me where change is needed

virtual left a reply on Redirector::with Does Not Exist.

Anyone help me

virtual started a new conversation Redirector::with Does Not Exist.

Hi, I am new in laravel, I am trying to reset password with laravel default authentication. It insert data in reset_password table successfully and login. But when reset password it did not redirect me in admin panel or user panel instead of it show an errror message Illuminate\Routing\Redirector::with does not exist.. . I am searched in google but can not find proper solution. Here the error class

C:\xampp\htdocs\electro_service\vendor\laravel\framework\src\Illuminate\Support\Traits\Macroable.php
        if (static::$macros[$method] instanceof Closure) {
            return call_user_func_array(Closure::bind(static::$macros[$method], null, static::class), $parameters);
        }
 
        return call_user_func_array(static::$macros[$method], $parameters);
    }
 
    /**
     * Dynamically handle calls to the class.
     *
     * @param  string  $method
     * @param  array  $parameters
     * @return mixed
     *
     * @throws \BadMethodCallException
     */
    public function __call($method, $parameters)
    {
        if (! static::hasMacro($method)) {
            throw new BadMethodCallException(sprintf(
                'Method %s::%s does not exist.', static::class, $method
            ));
        }
 
        $macro = static::$macros[$method];
 
        if ($macro instanceof Closure) {
            return call_user_func_array($macro->bindTo($this, static::class), $parameters);
        }
 
        return call_user_func_array($macro, $parameters);
    }
}
 

How can I solved this problem. Thanks in advanced

virtual left a reply on Method Illuminate\Routing\Redirector::with Does Not Exist.

Hi, I am face the same problem, Please help me how to solve this problem. I think here is not proper solution

27 Jul
1 month ago

virtual left a reply on Object Of Class Illuminate\Routing\Redirector Could Not Be Converted To String

Hi,I am successfully solved this problem. In RegisterController.php

protected $redirectTo;

  /**
   * Create a new controller instance.
   *
   * @return void
   */
  public function __construct()
  {
      if (Auth::check() && ((!empty(Auth::user()->role->role) == 0)||(!empty(Auth::user()->role->role) == 1)||(!empty(Auth::user()->role->role) == 2))) {
          $this->redirectTo=route('admin.dashboard');
      }else{
           $this->redirectTo='/';
      }
      $this->middleware('guest');
  }

Thanks for all to spent your time with mine.

26 Jul
1 month ago

virtual left a reply on Object Of Class Illuminate\Routing\Redirector Could Not Be Converted To String

@mstrauss sir i am trying your solution. but get the same error. what will next step?

virtual left a reply on Object Of Class Illuminate\Routing\Redirector Could Not Be Converted To String

@mstrauss sir here is the registerController

namespace App\Http\Controllers\Auth;

use App\Models\User; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Validator; use Illuminate\Foundation\Auth\RegistersUsers; use Illuminate\Support\Facades\Auth;

class RegisterController extends Controller {

use RegistersUsers;

protected $redirectTo;
public function __construct()
{
    if (Auth::check() && Auth::user()->role->role == 0) {
         return $next($request);
    }else{
        return redirect('/');
    }
    $this->middleware('guest');
}
protected function validator(array $data)
{
    return Validator::make($data, [
        'name' => ['required', 'string', 'max:255'],
        'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
        'password' => ['required', 'string', 'min:8', 'confirmed'],
    ]);
}
protected function create(array $data)
{
    return User::create([
        'name' => $data['name'],
        'email' => $data['email'],
        'password' => Hash::make($data['password']),
    ]);
}

}

virtual started a new conversation Object Of Class Illuminate\Routing\Redirector Could Not Be Converted To String

Hello when I am trying to register as a new user in my local app then get the above error through Response.php class. here the code

C:\xampp\htdocs\electro_service\vendor\symfony\http-foundation\Response.php }

/**
 * Sets the response content.
 *
 * Valid types are strings, numbers, null, and objects that implement a __toString() method.
 *
 * @param mixed $content Content that can be cast to string
 *
 * @return $this
 *
 * @throws \UnexpectedValueException
 */
public function setContent($content)
{
    if (null !== $content && !\is_string($content) && !is_numeric($content) && !\is_callable([$content, '__toString'])) {
        throw new \UnexpectedValueException(sprintf('The Response content must be a string or object implementing __toString(), "%s" given.', \gettype($content)));
    }

    $this->content = (string) $content;

    return $this;
}

/**
 * Gets the current response content.
 *
 * @return string Content
 */
public function getContent()
{
    return $this->content;
}

I am not understand this problem and how to solve this problem. Anyone help me .Thanks in advanced.

26 Nov
9 months ago

virtual left a reply on Display Single And Multiple Image From Database At The Same Time

@MUNAZZIL - sir i am trying this process but failed. which is being mentioned above.

{{ $imag->image_name }}

                @if($imag->multi==0)
                 <div class="blog-thumb">

                  <a href="#"><img src="{{asset($imag->images) }}" alt="" /></a>
              </div>
               @else
               <?php
               $vv=json_decode($imag->images, true);
               
                ?>
                 @foreach($vv as $imag)
                 {{$img}}
                  @endforeach
                
                 <div class="blog-thumb">

                  <a href="#"><img src="" alt="" /></a>
              </div>
            
             @endif

please review again and give better suggestion. Thanks

virtual left a reply on Display Single And Multiple Image From Database At The Same Time

@JASONLIMANTORO - Sir , here is my vie method of controller;

    public function show($id)
{
    $images = Image::where('category_id',$id)->get();
    $categories = Category::all();
    return view('front.imag.category-imag',[

        'images'=>$images,
        'categories'=>$categories,
        
    ]);
}

Here is my image upload method;

 public function store(Request $request)
 {
   if($request->hasfile('images'))
     {

        foreach($request->file('images') as $image)
        {
            $imageName=$image->getClientOriginalName();
            $directory = 'images/imag1/';
            $imgeUrl = $directory.$imageName;
           $image->move($directory, $imageName); 
            $data[] = $imgeUrl;  
        }
     }
     //$dd=json_encode($data);
  // dd(json_decode($dd));
   $Images = new Image();
   $Images->image_name = $request->image_name;
   $Images->category_id = $request->category_id;
   $Images->images = implode(',',$data);
   $Images->email_address = $request->email_address;
   $Images->password = $request->password;
   $Images->image_descriptions = $request->image_descriptions;
   $Images->save();
   $data = $Images->toArray();
    $data['pass'] = $request->password;
    Mail::send('front.mails.confirmation-mail', $data, function ($message) use ($data){
        $message->to($data['email_address']);
        $message->subject('Congratulation Mail');
    });
   return redirect('/imag-upload');
}

Here is my data table. how can i show single and retrieve and show multiple image from a column.

INSERT INTO images (id, image_name, category_id, images, email_address, password, image_descriptions, multi, created_at, updated_at) VALUES (1, 'gnfhfgh', '1', 'images/imag/Nature_-Fairy_Falls_1(1).jpg', '[email protected]', 'cvbcvbcvbcvb', 'cvbcvbvcbcv', 0, '2018-11-11 01:13:29', '2018-11-11 01:13:29'), (5, 'images 4', '3', 'images/imag/s34weissrosa.gif', 'rakibfdgabdur4@gmail.com', 'gdfgdfgdfg', 'dfgdfgdfgdgf', 0, '2018-11-14 01:49:43', '2018-11-14 01:49:43'), (6, 'test upload', '3', 'images/imag1/s27gelborange.gif', '[email protected]', '123456', 'test description', 0, '2018-11-14 03:15:44', '2018-11-14 03:15:44'), (13, 'sss', '1', 'images/imag1/f2.jpg,images/imag1/f3.jpg,images/imag1/f4.jpg,images/imag1/f5.jpg,images/imag1/f6.jpg,images/imag1/family-2923690_1280.jpg,images/imag1/img.jpg,images/imag1/kid.jpg', 'rakibabdur4@gmail.com', '1234', 'adad', 1, '2018-11-25 19:02:46', '2018-11-25 19:02:46');

25 Nov
9 months ago

virtual started a new conversation Display Single And Multiple Image From Database At The Same Time

Hi, i am new in laravel. So i am insert multi image url in a column but i also have single image url in the same table and i want to display all image in blade page. But i get an error when fetch multi image from a column of a table. The error is - Invalid argument supplied for foreach()

Here my blade page

{{$images}}
      @foreach($images as $imag)
      
      <div class="col-lg-3 col-md-6 mb-3">
          <div class="blog-post">
              <a  style="margin-left: 60px" href="{{ $imag->image_name }}">{{ $imag->image_name }}</a>
              
                @if($imag->multi==0)
                 <div class="blog-thumb">

                  <a href="#"><img src="{{asset($imag->images) }}" alt="" /></a>
              </div>
               @else
               <?php
               $vv=json_decode($imag->images, true);
               
                ?>
                 @foreach($vv as $imag)
                 {{$img}}
                  @endforeach
                
                 <div class="blog-thumb">

                  <a href="#"><img src="" alt="" /></a>
              </div>
            
             @endif
          </div>

          <div style="margin-top: 3px; margin-left: 60px">

            <a href="{{ route('imag-detail',['id'=>$imag->id]) }}"></a>
            <button type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#show_modal_{{$imag->id}}">
               Images Detail
           </button>
       </div>

       <!-- Modal -->

   </div>
   
   @endforeach

Here my controller query function

public function store(Request $request) { $category = new Category(); $category->category_name = $request->category_name; $category->category_description = $request->category_description; $category->save(); return redirect('/add-category'); }

Please help me ,how can i fixed it. Thanks in advanced

23 Sep
11 months ago

virtual left a reply on Send Automation Email From Localhost

@Snapey sir i want to send automation email everytime using localhost. I am already done this task but not send email automically. How do this task?

virtual left a reply on Send Automation Email From Localhost

@Snapey sir I did not understood why need at postmarkapp.com account

22 Sep
11 months ago

virtual started a new conversation Send Automation Email From Localhost

Hi, I want to send email from the localhost. I already read the laravel task scheduling documentation.https://laravel.com/docs/5.7/scheduling. I want to know is it posible to send automation email from localhost?. Thanks in advanced.

13 Sep
1 year ago

virtual left a reply on In The Case Of Send SMS Php Artisan Vendor:publish Command Is Not Working

aurawindsurfing sir, I read this documentation. But when run php artisan vendor:publish command then it is not execute after few seconds and don't create nexmo.php file inside config folder. So it is my main problem. How can i fixed it.

virtual left a reply on In The Case Of Send SMS Php Artisan Vendor:publish Command Is Not Working

aurawindsurfing sir, please tell me which config file will take to implementation for send SMS from laravel site

12 Sep
1 year ago

virtual started a new conversation In The Case Of Send SMS Php Artisan Vendor:publish Command Is Not Working

Hi guys,I am trying to send SMS to moble from the laravel project and follow this link. https://github.com/Nexmo/nexmo-laravel. so i need to execute a specific vendor package command. The command is php artisan vendor:publish is not do anything. I am searched in google but could not found any proper solution. How can i fixed it . Please help me. Thanks in advanced.

27 Jun
1 year ago

virtual started a new conversation Fetch All Data Two Table With Count Item Individually Groupby

Hi i am get a sql error, the error is

Syntax error or access violation: 1055 'sitemap.products.id' isn't in GROUP BY (SQL: select products.*, COUNT(products.brand_id) as total from products left join brand on products.brand_id = brand.brand_id group by products.brand_id)

One table is Brand CREATE TABLE brand ( brand_id int(11) NOT NULL, name varchar(255) NOT NULL ) Another table Products CREATE TABLE products ( id int(11) NOT NULL, name varchar(255) NOT NULL, slug varchar(255) NOT NULL, text longtext NOT NULL, new_price int(11) NOT NULL, old_price int(11) NOT NULL, image varchar(255) NOT NULL, video text NOT NULL, cat_id int(11) NOT NULL, brand_id int(11) NOT NULL, boolean_used int(11) NOT NULL, boolean_highlighted int(11) NOT NULL, deleted_at datetime NOT NULL, updated_at datetime NOT NULL, created_at datetime NOT NULL, published_at datetime NOT NULL )

And my sql query

$products=DB::table('products')->select('products.*', \DB::raw('COUNT(products.brand_id) as total'))->leftJoin('brand','products.brand_id','=','brand.brand_id')->groupBy('products.brand_id')->get();

her i need all data of products table and brand table brand name. at the same time i need to count product.brand_id groupby. how can i fixed it. please help me. thanks in advanced.

18 May
1 year ago

virtual left a reply on How Can I Send An SMS To Mobile With Laravel 5.6 On Localhost?

hello @wilburpowery sir , I am follow laravel documentation (notification part)but not implementation it. here my code--

First Install nexmo/client package. Then create Register Nexmo Account. Then configure below code into config/services.php file

'nexmo' => [ 'key' => env('a47516174'), 'secret' => env('HB2MH5266wKq0rTO'), 'sms_from' => '018xxxxxxxx', ],

Then create notification file laravel6\app\Notifications and below code

public function toNexmo($notifiable) { return (new NexmoMessage) ->content('Testing Nexmo SMS from Laravel 5'); }

And routes Route::get('/test', '[email protected]');

And controller

public function test(){ $user = new User(); $user->phone_number= '+88018xxxxxxxxxxx'; // Don't forget specify country code. $user->notify(new SMSNotification()); echo "hello";

}

but no sms sent to moble. what is the problem?

17 May
1 year ago

virtual started a new conversation How Can I Send An SMS To Mobile With Laravel 5.6 On Localhost?

Hello friends, I want to send sms to mobile phone by using laravel 5.6 and nexmo with localhost for test purpose.How can i complete it. Anyone please help me or any other solution. Thanks in advanced.

13 Jan
1 year ago

virtual left a reply on How Can I Print Range Slider 0 Index Value

topvillas sir, i am already try these process but get an error--

Uncaught TypeError: Cannot read property 'valuses' of undefined

script type="text/javascript"> $(document).ready(function(){ var slider = new Slider("#slider1"); slider.on("slide", function(event,ui) { console.log(ui.valuses[0]); }); });

how to solve it? plz help me

12 Jan
1 year ago

virtual left a reply on How Can I Print Range Slider 0 Index Value

topvillas sir, i am already try these process but get an error--

Uncaught TypeError: Cannot read property 'valuses' of undefined

script type="text/javascript"> $(document).ready(function(){ var slider = new Slider("#slider1"); slider.on("slide", function(event,ui) { console.log(ui.valuses[0]); }); }); how to solve it?

virtual started a new conversation How Can I Print Range Slider 0 Index Value

When i use getvalue() method everything fine.but when i print 0/1 index value console panel shown undefined. How can i fixed it. here my code

JS Bin $(document).ready(function(){ var slider = new Slider("#slider1"); slider.on("slide", function(slideEvt) { console.log(slider.getValue[0]); }); }); Lengths

how can i print 0 or 1 number index value seperately. thanks

30 Dec
1 year ago

virtual left a reply on Unlink(): Invalid Argument

thanks for helping @ cmdobueno sir

29 Dec
1 year ago

virtual left a reply on Unlink(): Invalid Argument

i am new learning laravels. i don't know everything of laravels cmdobueno sir why use this (Storage::delete($files_path)) line.

virtual started a new conversation Unlink(): Invalid Argument

How can i unlink my image path.all images are located at $uploadPath='storage/app/public/images/';

here the update function--- public function update_product(Request $request) { $this->imageCheck($request);

  return redirect()->action('[email protected]_product')->with('status','product info updated successfully');

    
}
 private function imageCheck($request)
    {
        $productById=Product::where('id',$request->id)->first();

        $productImage=$request->file('pro_img');
         //var_dump($productImage);
       if ($productImage) {
       // dd( $productById->productImage);
        unlink($productById->productImage);
        $imageName=$productImage->getClientOriginalName();
          $uploadPath='storage/app/public/images/';
          $productImage->move($uploadPath,$imageName);
          $url=$uploadPath.$imageName;

        $this->updateProductWithImage($request,$url);
    } else {
        $this->updateProductWithoutImage($request);
        
    }
    }
     private function updateProductWithImage($request,$url)
    {
    $product =  Product::find($request->id);
    $product->cat_id=$request->cat_id;
    $product->pro_name=$request->pro_name;
    $product->pro_code=$request->pro_code;
    $product->pro_info=$request->pro_info;
    $product->pro_img=$url;
    // $url=$uploadPath.$imageName;
    $product->pro_price=$request->pro_price;
    $product->spl_price=$request->spl_price;
    // return $product;
 //    dd($product->all());
    $product->save();
    // return redirect()->action('[email protected]_product')->with('status','product info updated successfully');
    }
     private function updateProductWithoutImage($request)
    {
       $product =  Product::find($request->id);
    $product->cat_id=$request->cat_id;
    $product->pro_name=$request->pro_name;
    $product->pro_code=$request->pro_code;
    $product->pro_info=$request->pro_info;
    // $url=$uploadPath.$imageName;
    $product->pro_price=$request->pro_price;
    $product->spl_price=$request->spl_price;
    // return $product;
 //    dd($product->all());
    $product->save();
    // return redirect()->action('[email protected]_product')->with('status','product info updated successfully');
    }

how can i fixed this problem

virtual left a reply on Column Not Found: 1054 Unknown Column ' Product__catgories.id

i can fixed my problem. thank you Snapey

27 Dec
1 year ago

virtual left a reply on Column Not Found: 1054 Unknown Column ' Product__catgories.id

Hello @Snapey sir, plz check again,i was given all code under--

here the problem--

Illuminate \ Database \ QueryException (42S22) SQLSTATE[42S22]: : 1054 Unknown column ' users.id' in 'on clause' (SQL: select * from articales left join users on users.id = articales.user_id)

------Here the users table---

virtual left a reply on Column Not Found: 1054 Unknown Column ' Product__catgories.id

Hello @Snapey sir,i was given all code under--

here the problem--

Illuminate \ Database \ QueryException (42S22) SQLSTATE[42S22]: : 1054 Unknown column ' users.id' in 'on clause' (SQL: select * from articales left join users on users.id = articales.user_id)

------Here the users table---

virtual left a reply on Column Not Found: 1054 Unknown Column ' Product__catgories.id

Hello @Snapey sir,i was given all code under--

here the problem--

Illuminate \ Database \ QueryException (42S22) SQLSTATE[42S22]: : 1054 Unknown column ' users.id' in 'on clause' (SQL: select * from articales left join users on users.id = articales.user_id)

------Here the users table---

virtual left a reply on Column Not Found: 1054 Unknown Column ' Product__catgories.id

i am manually set cat_id the products @Stratos

26 Dec
1 year ago

virtual started a new conversation Column Not Found: 1054 Unknown Column ' Product__catgories.id

i have got an SQL errors in my laravel projcet. the error is--- Illuminate \ Database \ QueryException (42S22) SQLSTATE[42S22]: Column not found: 1054 Unknown column ' product__catgories.id' in 'on clause' (SQL: select * from products left join product__catgories on product__catgories.id = products.cat_id)

here my product tabe---

public function up() { Schema::create('products', function (Blueprint $table) { $table->increments('id'); $table->string('pro_name'); $table->string('pro_code'); $table->double('pro_price'); $table->string('pro_info'); $table->string('pro_img'); $table->double('spl_price'); $table->timestamps(); }); }

And product__catgories table

public function up() { Schema::create('product__catgories', function (Blueprint $table) { $table->increments('id'); $table->string('name'); $table->timestamps(); }); }

Here Product module: