kuns25

kuns25

Member Since 1 Year Ago

Pune

Laravel Developer at Drogenide Softwares Pvt Ltd

Experience Points 10,860
Experience Level 3

4,140 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 89
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.

13 Aug
1 month ago

kuns25 left a reply on Implement Escrow Payments Like Upwork And Fiverr

have you done the integration ,right now i'm in the same situation can you guide to achieve it

16 Jul
2 months ago

kuns25 left a reply on Return View Error

@snapey i was still confuse ,Yeah Thanks for the detailed explanation , I always get happy when you join the conversation. i know how rewrite .htaccess rules , i was so eager that's why forgot about that .

Thanks Again.

kuns25 left a reply on Return View Error

@nakov yeah thanks for the solution i didn't use asset in some of my href/src.

kuns25 left a reply on Return View Error

Okay Done Sir Thanks

kuns25 left a reply on Return View Error

This is the the section

  <section class="banner_area" style="background: url({{ asset('images/background/Supriya-Heights.jpeg') }}); background-size:cover;height: 400px; background-position: center;">

i was facing this issue on my localhost , that is why uploaded on server , so i can share link with you guys .

kuns25 left a reply on Return View Error

when i'm returning view fron web.php its trying to fetch image from http://drogenidesoftwares.com/realestatedemo/public/images/background/Supriya-Heights.jpeg

but when im using route model binding and controller its trying to fetch image from http://drogenidesoftwares.com/realestatedemo/public/projects/images/background/Supriya-Heights.jpeg

the code is same in my blade file

why is this happening

kuns25 left a reply on Return View Error

Ya when i inspect both path are similar , its actually returning the same view , when im doing dd($id) im getting instance of CurrentProjects class.

kuns25 left a reply on Return View Error

My Controller

    public function show(CurrentProjects $id)
    { 
        return view('supriyaheights');
    }

web.php

Route::get('supriyaheights', function () {
    return view('supriyaheights');
});
Route::get('projects/{id}','[email protected]');


Im trying to make things dynamic

kuns25 started a new conversation Return View Error

when im directly returning view from web.php its working . when im try it from controller its messing with views

http://drogenidesoftwares.com/realestatedemo/public/projects/1 // from my controller

http://drogenidesoftwares.com/realestatedemo/public/supriyaheights // from web.php

i am simply returning same view from both my route and controller .

can you please tell where am i going wrong.

kuns25 left a reply on Laravel Mail Working Locally But Not On Server

It was my hosting issue , i was using godaddy , when i try it on siteground it worked .

12 Jul
2 months ago

kuns25 left a reply on Laravel Mail Working Locally But Not On Server

to test ive installed telescope laravel itself is not sending mail i can't find anything in mail of telescope

kuns25 left a reply on Laravel Mail Working Locally But Not On Server

no sir its not working. i searched again that laravel not sending mail not giving error , in answers its written try smtp instead of sendmail , but again Swift_TransportException Connection could not be established with host smtp.mailtrap.io [Connection refused #111] error

kuns25 left a reply on Laravel Mail Working Locally But Not On Server

I've tried with gmail as well was having same issue . I've already used laravel mail in many project never had any big issue . Should i use laravel notification or event

kuns25 left a reply on Difference Between Increments, And BigIncrements?

but why bigint by default most of time we will never have this much value or records

kuns25 started a new conversation Laravel Mail Working Locally But Not On Server

Hii

     I have created a simple contact form to send mail  on website owner email id ,  everything is working fine on my localserver im getting the mail , but when uploaded on hosting its giving me below error
Connection could not be established with host smtp.mailtrap.io [Connection refused #111]

When i googled this error i came to know instead of smtp mail driver use sendmail or mailgun , yeah when i did this i didn' get error and got the success msg , but not receiving the mail .

also i have tried config:clear cmd .

please tell me where am i going wrong.

My code

.env

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=25
MAIL_USERNAME=myusername
MAIL_PASSWORD=mypass
MAIL_ENCRYPTION=

mailcontroller

    Mail::send(new SendMail);
        return back()->with('msg','Thank You For Contacting us,we will get back to you soon');

sendmail.php

 public function build(Request $request)
    {
       return $this->view('email',['fname'=>$request->fname,'lname'=>$request->lname,'msg'=>$request->msg,'mobile'=>$request->mobile,'email'=>$request->email])->to('[email protected]')->subject('Website Contact Form');
   }

Thanks in advance

09 Jul
2 months ago

kuns25 left a reply on Laravel Passport Tables

@snapey can you please answer this question

14 Jun
3 months ago

kuns25 started a new conversation Guzzle Error The Request Entity's Media Type 'application/x-www-form-urlencoded' Is Not Supported For This Resource

Hii I Was trying to send POST request to a sms api but getting below error .

Client error: POST http://148.251.80.111:5665/api/SendSMS resulted in a 415 Unsupported Media Type response: {"Message":"The request entity's media type 'application/x-www-form-urlencoded' is not supported for this resource."}

my code is quite small

My Blade

<form action="{{ url('sendsms') }}" method="post">
            @csrf
            <input type="text" name="mobile" placeholder="Enter Mobile Number">
            <input type="submit" value="submit">
        </form>


my controller

try
    {   $client = new Guzzle;
        $response = $client->request('POST', 'http://148.251.80.111:5665/api/SendSMS', [
            'form_params' => [
                'field_name' => 'abc',
                'other_field' => '123',
                
                'headers' => [
                    'Accept'     => 'application/json',
                    'Content-Type'     => 'application/json',
                ]
            ]
        ]);
        $result = json_decode($response->getBody()); # '{"id": 1420053, "name": "guzzle", ...}'
        print_r($result);


    }
    catch(Exception $e){
        echo $e->getMessage(); 
    }

.Thanks in advance

16 May
4 months ago

kuns25 left a reply on Error On Migration

Either change original migration from bigIncrements() to just increments();

Or in your foreign key column do bigInteger() instead of integer().

https://laraveldaily.com/be-careful-laravel-5-8-added-bigincrements-as-defaults/

This article might help you

06 May
4 months ago

kuns25 left a reply on UnexpectedValueException The Response Content Must Be A String Or Object Implementing __toString(), "object" Given.

@FTIERSCH - I get it now , actually i was using query as input parameter in name attribute , i think we cannot use "query" key for request as it is used in laravel. when i change input name attribute to something else , its working fine . Thanks for the support sir :) .

kuns25 left a reply on UnexpectedValueException The Response Content Must Be A String Or Object Implementing __toString(), "object" Given.

@FTIERSCH - @ftiersch this is what i was trying to achieve

public function search(Request $request)
        { 
            $query= $request->input('query');
            $users = User::where('name','like',"%$query%")->get();

        return  view('searchresults')->with('users',$users);
        }

kuns25 started a new conversation UnexpectedValueException The Response Content Must Be A String Or Object Implementing __toString(), "object" Given.

I'm trying to return email that i received from request , simply by doing $request->email , its getting me above error , but its working completely fine when i type $request->input('email') . why is this happening , whats the difference between these two .

my Route :

Route::get('search','[email protected]');
Route::get('searchresults','[email protected]');

my view

    <form action="{{ url('searchresults') }}" method="get">

                <div class="form-group">
                    <label >Search User</label>
                    <input type="text" class="form-control" name="query">
                </div>
                <button class="btn btn-primary" type="submit">Submit</button>
            </form>

my search controller

public function search(Request $request)
    { 
        return  $query= $request->query;  
     
    }

//usually it works , never got this kind of error , not at least for this situation

01 May
4 months ago

kuns25 left a reply on [5.3] Multi Auth Configuration Problem: Guards Use Same Session

@HESTO - @hesto Hii I've Installed the package i can't find where admin/home route is defined , or from which controller its returning me the view admin.home blade file , can you help me .

25 Apr
4 months ago

kuns25 left a reply on Error Exception Array To String Conversion In Curl

@MVD - @mvd yes I'm excecuting the api request ,just forgot to add in above question , if im using http_build_query i'm getting blank response

kuns25 started a new conversation Error Exception Array To String Conversion In Curl

Hi I'm trying to to Integrate Hubtel Payment Gateway but getting Array to string Conversion Error Exception .

if i do CURLOPT_POSTFIELDS =>http_build_query ($invoice), im getting blank response

please help

     $items = ["name" => "Harry Potter", "quantity" => 1, "unitPrice" => 50];
      $invoice = array("items" => $items, "totalAmount" => 1, "description" => "test", "callbackUrl" => "https://localhost:8000/status","returnUrl"=>"https://localhost:8000/return","cancellationUrl"=>"https://localhost:8000/cancel",
        "merchantBusinessLogoUrl"=>"https://localhost:8000/wallet","merchantAccountNumber"=>"HM0409180006","clientReference"=> '1');
      $curl = curl_init();

      curl_setopt_array($curl, array(
        CURLOPT_URL => "https://api.hubtel.com/v2/pos/onlinecheckout/items/initiate",
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_ENCODING => "",
        CURLOPT_MAXREDIRS => 10,
        CURLOPT_TIMEOUT => 30,
        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        CURLOPT_CUSTOMREQUEST => "POST",
        CURLOPT_POSTFIELDS => $invoice,
        CURLOPT_HTTPHEADER => array(
          "Authorization: Basic bjJXS0o1Qjo0saMWU4NzA4ZS0wODVkLTQ0NDwUtOTQ3ZS1hZjBiODlkNzI1OWY=",
          "Content-Type: application/json",
          "Postman-Token: 2bd373c8-3669-4f5f-93e9-d3001af0a9cff",
          "cache-control: no-cache"
        ),
      ));
23 Apr
4 months ago

kuns25 started a new conversation How Much Of Code Syntax You Guys Remember?

Hii , I started my career as web developer last year. Well half of the time i have to look back for my last written code to check how i did that. I was wondering you guys ever had the same problem . I mean how much of the things you remember. There are so many languages/libraries/frameworks of all of which you have to remember the syntax.

There is Core Php/ Laravel/codeigniter/ then vuejs/vanillajs/jquery/ and much more like firebase/ajax/axios/curl/oop/guzzle/vuex/nuxt/redis/unit testing/sass/bootstrap all those sql queries .and each of these has there own big world.

I'm really bad at explaining things, Hope you Understand what im trying to say

Please Guide .

01 Mar
6 months ago

kuns25 left a reply on How Do I Display Only Eloquent Related Data In Blade File

@D9705996 - Yeh thanks man this was simple solution , i was so naive back then, now after few months i can understand what everyone was trying to tell.

26 Feb
6 months ago

kuns25 left a reply on Method Illuminate\Database\Eloquent\Collection::orderBy Does Not Exist.

@SNAPEY - ya actually im adding show more button , thats why also loading all posts

23 Feb
6 months ago

kuns25 left a reply on Method Illuminate\Database\Eloquent\Collection::orderBy Does Not Exist.

Thanks for replying ,I'm getting this error now ,

Too few arguments to function Illuminate\Support\Collection::get(), 0 passed in C:\xampp\htdocs\laravel\twitter\app\Http\Controllers\HomeController.php on line 26 and at least 1 expected
 return $posts = $allposts->take($request->get('limit', 20))->sortByDesc('created_at')->get(); 

can you please check

kuns25 started a new conversation Method Illuminate\Database\Eloquent\Collection::orderBy Does Not Exist.

This Query Giving me above error


$allposts =  Post::whereIn('user_id',$request->user()->following()->pluck('follower_id')->push($request->user()->id)) ->with('user')->get();

 return $posts = $allposts->take($request->get('limit', 20))->orderBy('created_at', 'desc')->get();

Thanks in advance

21 Feb
6 months ago

kuns25 started a new conversation How Do You Guys Create Admin Panel In Laravel

Hii , Just wanted to know what steps you guys follow to create Admin Panel (Multi Auth) in Laravel . Like do you use any admin panel Generator like voyager ,( I don't know how to use that yet) , or Use any admin related package or Create Seperate Auth Controller for admin overriding default auth methods .

Also do you Create Separate model for admin or just add isAdmin field in User Model / Database .

please give me tips for creating admin panel in laravel.

Thanks

17 Feb
7 months ago

kuns25 left a reply on Passing Data From Child Vue Component Via Events Is Giving Undefined

Sorry for the trouble i don't know what happen but when i re run npm watch it solved it problem

kuns25 started a new conversation Passing Data From Child Vue Component Via Events Is Giving Undefined

I'm very new to vue , i have 3 simple components in my laravel project , one PostForm to post a tweet , and others to show the post on timeline . I am using axios to post and get data from backend . When im posting a tweet its getting saved in my database , but when i pass data by event , its giving https://snag.gy/Cjlaw6.jpg error to me.

My Code is here .

PostForm component

<template>
    <form action="#" class="form-vertical" @submit.prevent="post">
        <div class="form-group">
            <textarea name="body" id="" cols="30" rows="3" class="form-control" placeholder="Write something likable" v-model="body"></textarea>  
        </div>
        <button type="submit" class="btn btn-primary">Post it!</button>
    </form>
</template>

<script>
import eventhub from '../event'
export default{
    data(){
        return{
            body:null
        }
    },
    methods:{
        post(){
        
            axios.post('posts',{
                body:this.body
            }).then((response)=>{
                
            eventhub.$emit('post-added', response.body)
                this.body=null
            })
        }
    }
}
</script>

when i console.log(response.data) i am getting everything properly https://snag.gy/vNYL57.jpg , and then im emitting event (post-added) to my timeline component.

Timeline Component

<template>
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-md-8">
                <div class="card">
                    <div class="card-header">Timeline</div>
                    <div class="card-body">
                        <postform></postform>
                        <hr>
                        <post v-for="post in posts" :post="post" :key="post.index"></post>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import eventhub from '../event'
import Post from './Post.vue' 
import postform from './PostForm.vue'

export default {
    data(){
        return{
            posts:[]
        }
    } ,
    components:{
        Post,postform
    }
    ,
    methods:{
        addpost(record){
        
        }
    },
    mounted() {
        eventhub.$on('post-added',this.addpost)
        axios.get('/posts').then((response)=>{
            this.posts=response.data
            
        })
    }
}
</script>

I am catching that post-added event in mounted , and then passing the value to addpost method(record) .This is where i am getting the attached error https://snag.gy/Cjlaw6.jpg .

In addpost method when im trying to console/log(record) its giving me undefined , i think this is the error and i have no idea why its giving me undefined https://snag.gy/Hz1Xo3.jpg

note in my event.js file which is i'm importing has this code module.exports= new Vue() only

Thanks in advance ,

16 Feb
7 months ago

kuns25 left a reply on How To Turn Off "build Sucess" Notifications From Laravel Mix?

ok if anyone is saying this isn't working you have to close / terminate and re run your npm run watch after adding mix.disableSuccessNotifications();

07 Feb
7 months ago

kuns25 left a reply on Forget Password

if you are saying you want to send otp about forget password to user , you can use twilio for that

27 Jan
7 months ago

kuns25 left a reply on Need Help In Twilio Sms API Integration

@BOBBYBOUWMANN - Hii Really Thanks for replying to my question , Actually i have never integrated a third party api without any packages , can you please guide me or share any tutorials where i can learn how to integrate api by reading simply documentation , i tried finding on youtube , but most of them are about using packages .

Also there is one more twilio package which dose not required notification https://github.com/aloha/laravel-twilio

i also successfully integrated this package in laravel 5.7 , but my current project is in laravel 5.3.

in aloha readme its written

And make these objects resolvable from the IoC container:

Aloha\Twilio\Manager (aliased as twilio)
Aloha\Twilio\TwilioInterface (resolves a Twilio object, the default connection object created by the Manager).
 

i Can't understand this step for 5.3 .

Help!!

Thanks in advance

kuns25 started a new conversation Need Help In Twilio Sms API Integration

Hii , Im using http://laravel-notification-channels.com/twilio/ package , for integration of twilio sms .

I am verifying user mobile number during registration . I did all the configuration given in the package , and luckily im getting sms as well , user is getting verified as well .

I want to change the flow of verification of user , currently im first saving user with mobile number in database , then sending sms .i want to verify mobile number before saving data in Database . in package its given we can we can send sms by using below function in notifiable model , but for request we dont use any model , how can i fix that ,i dont know how to send sms to input mobile no.,

// code to enter in notifiable user model
public function routeNotificationForTwilio()
{
    return '+1234567890';    // or we can say $this->mobile
}

Please Help me how can i pass my $request->mobile in my notification

The Code is pretty simple .

you can check it

My web.php

<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::get('verifyotp', function () {
    return view('verifyotp');
});


Route::post('/verifyotp','[email protected]'); 
Route::post('/resendotp','[email protected]');  
Auth::routes();

 

Route::group(['middleware'=>'verifyotp'],function(){
Route::get('/home', '[email protected]')->name('home');

});

my login controller

<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;

class LoginController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Login Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles authenticating users for the application and
    | redirecting them to your home screen. The controller uses a trait
    | to conveniently provide its functionality to your applications.
    |
    */

    use AuthenticatesUsers;

    /**
     * Where to redirect users after login.
     *
     * @var string
     */
    protected $redirectTo = '/home';

    
    public function __construct()
    {
        $this->middleware('guest')->except('logout');
    }



    protected function attemptLogin(Request $request)
    {
        
     $result= $this->guard()->attempt(
        $this->credentials($request), $request->filled('remember')
    );
     if ($result && auth()->user()->verifyotp==0) { 
         auth()->user()->sendotp();      
     }

     return $result;
     
 }

 
}


my model

<?php

namespace App;

use App\Notifications\otpnotification;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Cache;

class User extends Authenticatable
{
    use Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password','mobile','verifyotp'
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];

public function otpkey(){
        return "otp_for_{$this->id}";
    }


    public function Cachetheotp(){

        $otp = rand(10000,1000);
        Cache::put([$this->otpkey()=>$otp],now()->addSeconds(20));
        return $otp;


    }

    public function otp(){

        return Cache::get($this->otpkey());

    }


    public function sendotp(){
 
        $otp = $this->Cachetheotp();
    $this->notify(new otpnotification($otp));     
 
   }

   public function routeNotificationForTwilio()
{
    return $this->mobile;
}
 
}


my notification

<?php

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use NotificationChannels\Twilio\TwilioChannel;
use NotificationChannels\Twilio\TwilioSmsMessage;
use Illuminate\Notifications\Notification;


class otpnotification extends Notification
{
    use Queueable;

public $otp;
    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct($otp)
    {
        $this->otp = $otp;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
     public function via($notifiable)
    {
        return [TwilioChannel::class];
    }

      public function toTwilio($notifiable)
    {
        return (new TwilioSmsMessage())
            ->content("Your Verification code is {$this->otp}");
         
    }


    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return \Illuminate\Notifications\Messages\MailMessage
     */
    public function toMail($notifiable)
    {
        return (new MailMessage)
                    ->line('The introduction to the notification.')
                    ->action('Notification Action', url('/'))
                    ->line('Thank you for using our application!');
    }

    /**
     * Get the array representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function toArray($notifiable)
    {
        return [
            //
        ];
    }
}


18 Jan
8 months ago

kuns25 left a reply on Cant Send Mail In Laravel 5.3

@REALRANDYALLEN - Broo Thanks.

Config:clear

This Helped

kuns25 left a reply on Cant Send Mail In Laravel 5.3

@MARTENVANURK - its fine im already aware of that , ill reset it , do you know the solution.

kuns25 left a reply on Cant Send Mail In Laravel 5.3

yes , heres my .env

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=a3f1dcf02c001e    
MAIL_PASSWORD=58fbbe5156119c
MAIL_ENCRYPTION=null

kuns25 started a new conversation Cant Send Mail In Laravel 5.3

Hii , Im trying to send mail in my laravel 5.3 project , but im not receiving any mail , neither im getting any error , also mail code when i use in laravel 5.7 im receiving mail on my mailtrap .

please guide me if there is any difference in laravel 5.3 & 5.7 mail.

code is quite simple , please help

My Route


Route::get('contacts','[email protected]');


My Controller

<?php

namespace App\Http\Controllers;

use App\Mail\mailtrap;
use Illuminate\Support\Facades\Mail;

  
class MailController extends Controller
{
    public function index(){
    
    Mail::to('[email protected]')->send(new mailtrap());
         
    }
}
 

my mailable

<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class mailtrap extends Mailable
{
    use Queueable, SerializesModels;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->view('email');
    }
}

my view

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Mail Send</title>
</head>
<body>

    <h3>You Have Received Enquiry From Website</h3>
    
    


</body>
</html> 

14 Jan
8 months ago

kuns25 left a reply on Paid Laracast Tutorials?

@jeffreyway I am getting "Your card does not support this type of purchase" error. Can i pay with paypal or any other medium

25 Dec
8 months ago

kuns25 left a reply on Paid Laracast Tutorials?

@JEFFREYWAY - its showing 16 series for laravel , is that all .

17 Dec
9 months ago
12 Dec
9 months ago

kuns25 left a reply on Laravel Does Not Display Images In The View From Storage Folder

I Suggest you to link your storage folder to public folder by using php artisan storage:link command

then try

` <img src="{{ asset('storage/public/cover_images'. $book->image )}}"

`

kuns25 left a reply on Check If Input Value Before Update

while updating you dont need to check or validate anything Laravel Does this automatically for you yes if you are asking in case of user password update you can validate if user is entering same old password with below password comparison ` $user =Auth::id();

if(Hash::check($request->password, $finduser->password)) { return 'Old password and new password cant be same' } else { $user->password = bcrypt($request->password); $user->save(); } ` obviously you can return response with flash session , and many more things , its all up to you.

06 Dec
9 months ago

kuns25 left a reply on UPGRADE TO LARAVEL 5.7 FROM 5.4

@PETRIT - tried to upgrade to 5.5 still showing the older version