nikhil_lu210

nikhil_lu210

Member Since 10 Months Ago

Sylhet, Bangladesh

Web Frontend Developer at Veechi Technology

Experience Points 1,090
Experience Level 1

3,910 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.

09 Mar
5 months ago

nikhil_lu210 left a reply on How To Deploy Laravel Project Directly From Github/Gitlab...?

@TOWHID - Sorry, but may be you didn't get my point actually. I want to deploy my Project on Live server with domain hosting. Basically with cPanel.

07 Mar
5 months ago

nikhil_lu210 started a new conversation How To Deploy Laravel Project Directly From Github/Gitlab...?

Is there have any process to Deploy a Laravel Project from my Gitlab or Github...? So that I can change anything directly from my local working Zone and update with normal git commit and push....

nikhil_lu210 left a reply on Implement Sweet Alert Delete

@DEVIT.GG - It's Not Working For me...

06 Mar
5 months ago

nikhil_lu210 left a reply on How To Delete After Confirmation By Sweet-alert...?

@FGUNZ06 - But I'm not using Form (submit type) here. And Ajax also...

nikhil_lu210 started a new conversation How To Delete After Confirmation By Sweet-alert...?

I have linked sweetalert plugin for my confirmation message. But it's not getting the confirmation command (onclick yes/confirm button).

This is my delete button:

<a id="demoSwal" href="{{ route('setting.website_type.destroy', ['id' => $websiteType->id]) }}" class="btn btn-light btn-sm btn-delete demoSwal" data-toggle="tooltip" data-placement="top" title="Delete This Type"><i class="far fa-trash-alt"></i></a>

This is My JS Code:

$(document).ready(function(){
    $('.demoSwal').click(function(){
            swal({
                title: "Are you sure?",
                text: "You will not be able to recover this file!",
                type: "warning",
                showCancelButton: true,
                confirmButtonText: "Yes, delete it!",
                cancelButtonText: "No, cancel plx!",
                closeOnConfirm: false,
                closeOnCancel: false
            },
            function(isConfirm) {
                if (isConfirm) {
                    swal("Deleted!", "Your Data file has been deleted.", "success");
                } else {
                    swal("Cancelled", "Your Data file is safe :)", "error");
                }
            });
        });
});

This is my Controller Code:

public function destroy($id)
    {
        $delete_website_type = WebsiteType::find($id);
        $delete_website_type->delete();

        return redirect()->back();

    }

Please Give me the solution...

30 Jan
6 months ago

nikhil_lu210 left a reply on How To Count Unique Website Visitor By Laravel 5.7 ?

@CRONIX - No. Can you please give me any easy solution (Better, if you give me any code/link) for tracking the number of my website visitor from admin panel...?

nikhil_lu210 left a reply on How To Count Unique Website Visitor By Laravel 5.7 ?

@CRONIX - Yes... I have already been done all the process and changes from the documentation. like composer install, migration, database change etc. etc...

But, after calling the value its returning [] only... https://imgur.com/a/Hpv5aec

nikhil_lu210 left a reply on How To Count Unique Website Visitor By Laravel 5.7 ?

@DOUGLASAKULA -

Admin Controller:

<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Model\Admin\Contact;
use App\Model\Admin\Reservation;
use Tracker;

class HomeController extends Controller
{
    public function __construct()
    {
        $this->middleware('auth');
    }
    public function index()
    {
        $contacts = Contact::all()->count('id');
        $reservations = Reservation::all()->count('id');
        // $visitors = Tracker::sessions('id')->count();
        $visitors = Tracker::users(60 * 24 * 7);
        dd($visitors);
        return view('admin.dashboard.index')
            ->withContacts($contacts)
            ->withReservations($reservations)
            ->withVisitors($visitors);
    }
}

Its Returning : https://imgur.com/ECnQfwo

This is my Website Home Controller:

<?php

namespace App\Http\Controllers\Frontend;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Model\Admin\Contact;
use Session;
use Tracker;

class HomeController extends Controller
{
    public function index()
    {
        return view('frontend.home.index');
    }
}

And I wanna show the value here, in my Admin Dashboard:

<div class="col-md-4">
    <div class="card p-4">
        <div class="card-body d-flex justify-content-between align-items-center">
            <div>
                <span class="h4 d-block font-weight-normal mb-2">{{$visitors}}</span>
                <span class="font-weight-light"><strong>TOTAL VISITOR</strong></span>
            </div>

            <div class="h2 text-muted">
                <i class="icon icon-eyeglass"></i>
            </div>
        </div>
    </div>
</div>

But it's showing me this [] brackets only: https://imgur.com/a/Hpv5aec

29 Jan
6 months ago

nikhil_lu210 left a reply on How To Count Unique Website Visitor By Laravel 5.7 ?

@DOUGLASAKULA - Opps Sorry... Actually I did

dd($visitors);

but i copied that code before dd... btw, result is same... only [] this one...

nikhil_lu210 left a reply on How To Count Unique Website Visitor By Laravel 5.7 ?

@DOUGLASAKULA -

Admin Controller:

<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Model\Admin\Contact;
use App\Model\Admin\Reservation;
use Tracker;

class HomeController extends Controller
{
    public function __construct()
    {
        $this->middleware('auth');
    }
    public function index()
    {
        $contacts = Contact::all()->count('id');
        $reservations = Reservation::all()->count('id');
        // $visitors = Tracker::sessions('id')->count();
        $visitors = Tracker::users(60 * 24 * 7);
        dd($reservations);
        return view('admin.dashboard.index')
            ->withContacts($contacts)
            ->withReservations($reservations)
            ->withVisitors($visitors);
    }
}

Its Returning : https://imgur.com/ECnQfwo

This is my Website Home Controller:

<?php

namespace App\Http\Controllers\Frontend;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Model\Admin\Contact;
use Session;
use Tracker;

class HomeController extends Controller
{
    public function index()
    {
        return view('frontend.home.index');
    }
}

And I wanna show the value here, in my Admin Dashboard:

<div class="col-md-4">
    <div class="card p-4">
        <div class="card-body d-flex justify-content-between align-items-center">
            <div>
                <span class="h4 d-block font-weight-normal mb-2">{{$visitors}}</span>
                <span class="font-weight-light"><strong>TOTAL VISITOR</strong></span>
            </div>

            <div class="h2 text-muted">
                <i class="icon icon-eyeglass"></i>
            </div>
        </div>
    </div>
</div>

But it's showing me this [] brackets only: https://imgur.com/a/Hpv5aec

nikhil_lu210 left a reply on How To Count Unique Website Visitor By Laravel 5.7 ?

@DOUGLASAKULA - Let Me clear one thing. I have Separate Controller

Http\Controller\Frontend\HomeController

it's controlling the website home page:

frontend\home\index.blade.php

For Admin I have different Controller for dashboard.

Http\Controller\Frontend\DashboardController

it's controlling the website home page:

Admin\dashboard\index.blade.php

here I want to get the result of total visitor number of the website.

Now How can I get the value from the website to my Admin Dashboard...??

nikhil_lu210 left a reply on How To Count Unique Website Visitor By Laravel 5.7 ?

@DOUGLASAKULA - I have already been done all the process which was described in the documentation. And implemented as you briefed. But Its not showing the visitor number.... @DOUGLASAKULA

28 Jan
6 months ago

nikhil_lu210 started a new conversation Input Code And Format As Needed...??

I want to develop a site as below as I describe:

Suppose, I have a structure :

<!DOCTYPE html>
<html>

<head>
        <!-- Here I want to take input the meta tag with links -->
    
    <style>
        <!-- Here I want to take input css -->
    </style>
</head>

<body>
    <!-- Here I want to input codes -->

    <!-- Here I want to take Input all the script file & script links -->
    <script>
        // Here I want to take input script code
    </script>
</body>

</html>

After getting all input, the whole code will be formatted as template as I want.

So, Can anyone help me with giving me any suggestion, how can I take input those code and properly format them...??

nikhil_lu210 left a reply on How To Count Unique Website Visitor By Laravel 5.7 ?

@DOUGLASAKULA - @douglasakula Here I want to show the number of total unique visitor per week only. https://imgur.com/a/xCKHYFq

<div>
    <span class="h4 d-block font-weight-normal mb-2">0</span>
    <span class="font-weight-light"><strong>TOTAL VISITOR</strong></span>
</div>

nikhil_lu210 started a new conversation How To Count Unique Website Visitor By Laravel 5.7 ?

Recently I'm developing a Restaurant Website Dashboard. They want to track the total unique number of visitor to their website. Now How can I solve this problem...? Can anyone please describe how to Count the Visitor Number through Laravel...?

26 Jan
6 months ago

nikhil_lu210 left a reply on Htmlspecialchars() Expects Parameter 1 To Be String, Object Given

@TYKUS - Thanks @... I Just Change the Variable name from 'message' to 'msg'... And it's done...

nikhil_lu210 left a reply on Htmlspecialchars() Expects Parameter 1 To Be String, Object Given

@vilfago Sorry, But I didn't get the point ... would you please explain...?

nikhil_lu210 started a new conversation Htmlspecialchars() Expects Parameter 1 To Be String, Object Given

I'm trying to send mail by template from contact page. Mail sent successfully but when I'm trying to show the user given message then it shows a problem as bellow:

"htmlspecialchars() expects parameter 1 to be string, object given (View: C:\laragon\www\square_chili\resources\views\partials\email\contactEmail.blade.php)"

contactEmail.blade.php:

<div class="card-body">
    <div class="subject">
        <h4>Subject</h4>
        <div class="subject-div">
            <h3>{{ $subject }}</h3>
        </div>
    </div>
    <div class="name">
        <h4>Name</h4>
        <div class="name-div">
            <h3>{{ $name }}</h3>
        </div>
    </div>
    <div class="email">
        <h4>Email Address</h4>
        <div class="email-div">
            <h3>{{ $email }}</h3>
        </div>
    </div>
    <div class="message">
        <h4>Message</h4>
        <div class="message-div">
            <h6>{{ $message }}</h6>
        </div>
    </div>
</div>

ContactController (store):

$mailData = [
    'name' => $request - > first_name.
    " ".$request - > last_name,
    'email' => $request - > email,
    'subject' => $request - > subject,
    'message' => $request - > message
];

Mail::send('partials.email.contactEmail', $mailData, function($message) use($mailData) {
    $message - > to($mailData['email']);
    $message - > subject($mailData['subject']);
    $message - > from('[email protected]');
});
14 Jan
7 months ago

nikhil_lu210 started a new conversation How To Add Google ReCaptcha In Contact Form Using Ajax & PHP?

I want to add google recaptcha into my web contact validation form. What should I do...?

Form:

<form id="contact">
    <div class="row">
        <div class="col-md-12">
            <div id="msg"></div>
        </div>
        <div class="col-sm-6 col-xs-12">
            <div class="input-field-wrap">
                <input type="text" class="input-field" placeholder="First Name *" name="first_name" required>
                <div class="focus"></div>
            </div>
            <div class="empty-sm-20 empty-xs-20"></div>
        </div>
        <div class="col-sm-6 col-xs-12">
            <div class="input-field-wrap">
                <input type="text" class="input-field" placeholder="Last Name" name="last_name">
                <div class="focus"></div>
            </div>
            <div class="empty-sm-20 empty-xs-20"></div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-6 col-xs-12">
            <div class="input-field-wrap">
                <input type="email" class="input-field" placeholder="Email *" name="email" required>
                <div class="focus"></div>
            </div>
            <div class="empty-sm-20 empty-xs-20"></div>
        </div>
        <div class="col-sm-6 col-xs-12">
            <div class="input-field-wrap">
                <input type="text" class="input-field" placeholder="Subject" name="subject">
                <div class="focus"></div>
            </div>
            <div class="empty-sm-20 empty-xs-20"></div>
        </div>
    </div>
    <div class="input-field-wrap">
        <textarea placeholder="Message *" class="input-field" name="message" required></textarea>
        <div class="focus"></div>
    </div>
    <div class="empty-sm-30 empty-xs-30"></div>
    <div class="text-center">
        <div class="page-button button-style-1 type-2">
            <input type="submit" id="submit-btn">
            <span class="txt">SEND MESSAGE</span><i></i>
        </div>
    </div>
</form>

Ajax Request

$('#submit-btn').click(function(event) {
    $.ajax({
        dataType: 'JSON',
        url: 'mail-process.php',
        type: 'POST',
        data: $('#contact').serialize(),
        beforeSend: function() {
            $('.txt').html('SENDING...');
        },
        complete: function() {
            $('.txt').html('SEND MESSAGE');
        },
        error: function() {
            $('#msg').html('<div class="alert alert-danger">Please Fillup Properly, and Try Again.</div>').hide();
        }
    });
    $('#msg').html('<div class="alert alert-success">Message successfuly Sent.</div>').hide().fadeIn(1500);
    $('#msg').addClass('d-none');
    $('#contact')[0].reset();
    return false;
});

PHP

<?php
require_once 'mailer/class.phpmailer.php';
require_once 'database/db-connection.php';


$first_name = $_POST['first_name'];
$last_name  = $_POST['last_name'];
$email      = $_POST['email'];
$subject    = $_POST['subject'];
$message    = $_POST['message'];

$name = $first_name. ' ' . $last_name;


/*=======================================================
=< Contact Controller for Inserting Data into Database >=
=========================================================*/
mysqli_query($connection,"insert into contacts (name, email, subject, message) values ('$name', '$email', '$subject', '$message')") or die(mysqli_error());



$message ='
Name:            '.$name. '<br />
Email:           '.$email.'<br />
Subject:         '.$subject.'<br />
Message:         '.$message. '<br />
';


// creates object
$mail = new PHPMailer(true);
$reply_mail = new PHPMailer(true);
$reply_mail_id = $email; //Client email
$subject = "Contact Mail"; //client subject 

$reply_message = "Dear Customer, Thank you for your message. We will contact you soon"; //client message

$mail->MsgHTML($message);
$reply_mail->MsgHTML($reply_message);


try
{
$mail->IsSMTP();
$mail->isHTML(true);
$mail->SMTPDebug = 0;
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->Port = '465';
$mail->Username ="[email protected]";
$mail->Password ="pass";
$mail->SetFrom($_POST['email']);
$mail->AddReplyTo($_POST['email']);
$mail->Subject = $subject;
$mail->MsgHTML($message);
$mail->Body = $message;
$mail->AltBody = $message;


//Reply to client
$reply_mail->IsSMTP();
$reply_mail->isHTML(true);
$reply_mail->SMTPDebug = 0;
$reply_mail->SMTPAuth = true;
$reply_mail->SMTPSecure = "ssl";
$reply_mail->Host = "smtp.gmail.com";
$reply_mail->Port = '465';
$reply_mail->AddAddress($reply_mail_id); // Client get success email
$reply_mail->Username ="[email protected]";
$reply_mail->Password ="pass";
$reply_mail->SetFrom("[email protected]", "Restaurant");
$reply_mail->AddReplyTo($_POST['email']);
$reply_mail->Subject = "New Reservation";
$reply_mail->MsgHTML($reply_message);
$reply_mail->Body = $reply_message;
$reply_mail->AltBody = $reply_message;



    // Send To
    $mail->AddAddress("[email protected]", "Restaurant"); // Where to send it - Recipient
    $result = $mail->Send();
    $reply_result = $reply_mail->send();
if($reply_mail->Send())
{
    $previous = "javascript:history.go(-1)";
    echo "<script>
    alert('Thanks a lot for connect with us. We Will Contact you very soon.');
    window.location.href= '$previous';
    </script>";
}

}
catch(phpmailerException $ex)
{
$msg = "
".$ex->errorMessage()."
";
}
?>
12 Jan
7 months ago

nikhil_lu210 started a new conversation Laravel Image Resize Problem (image-intervention)

I am trying to resize the input image in laravel controller with image-intervention. Now I'm getting a problem. My Code:

if ($request - > hasFile('profile_picture')) {
    $path = time().
    'team.'.$request - > profile_picture - > getClientOriginalExtension();
    $resize_image = Image::make($request - > profile_picture) - > resize(300, 300) - > encode('jpg');
    $resize_image - > save(public_path('images'), $path);
    $team - > profile_picture = $path;
} //For Storing the image

Its showing the error like this:

"Quality must range from 0 to 100." //This is the error message
11 Jan
7 months ago

nikhil_lu210 left a reply on Laravel Project Deployment Problem In Shared Hosting (000webhost)

@gurur this is my .htaccess file code:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

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

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

nikhil_lu210 left a reply on Laravel Project Deployment Problem In Shared Hosting (000webhost)

@snapey , No. it's not triggering the if condition. And, the public_path('images') aren't writeable by the server

nikhil_lu210 left a reply on Laravel Project Deployment Problem In Shared Hosting (000webhost)

@snapey I have also tried this. And its working on localhost, but not in webhost..

$user = User::find(Auth::user()->id);
        if($request->hasFile('avatar')){
            
        $path = time().'.'.$request->avatar->getClientOriginalExtension();
        $request->avatar->move(public_path('images'), $path);
  
        $user->avatar = $path;
         }

nikhil_lu210 started a new conversation Laravel Project Deployment Problem In Shared Hosting (000webhost)

I have Deployed a Laravel Project on a shared hosting "www.000webhost.com". But There is some problem here that I'm facing now. The Problems are:

  1. Image Upload (Images are not storing in database & public folder)
  2. Mail Not sending.

Can anyone please give me the solution...?

if ($request->hasfile('avatar')){  
            $image = $request->file('avatar');
            $filename  = time() . 'pp.' . $image->getClientOriginalExtension();
            $location = base_path().'/images/' . $filename;
            Image::make($image)->save($location);
            $user->avatar = $filename;               
        }
14 Dec
8 months ago

nikhil_lu210 started a new conversation How To Change Owl Carousel Slide, Depending On Current Time...?

I have some predefined Carousel Item based on Time. As example: Carousel-01 (Time: 8.30) Carousel-02 (Time: 9.35) Carousel-03 (Time: 10.20)

Now, when the time is greater then 8.30 then, I want to show the Carousel-02 (Time: 9.35) as the active carousel item. When the time is greater then 9.35 then, I want to show the Carousel-03 (Time: 10.20) as the active carousel item. And, When the time is greater then 10.20 then, I want to show the Carousel-01 (Time: 8.30) as the active carousel item. So, what can I do.

[[ Note: I'm using Owl-Carousel 2 ]]

18 Nov
8 months ago

nikhil_lu210 left a reply on How To Upload And Show CSV File Data Into Laravel ?

Can You Please Briefly Describe Full Process ( Model, Controller, Migration, Route, View )...? @

nikhil_lu210 started a new conversation How To Upload And Show CSV File Data Into Laravel ?

I Want to Upload this CSV file ( https://www.sendspace.com/file/wwg8e3 ) into my laravel project. And wanna show the data into this ( http://uploadpot.com/1ovzztebwxz9 ) database table...

Can anyone please help me how can I upload and read the CSV file data...?

08 Nov
9 months ago

nikhil_lu210 started a new conversation How To Make Dependent / Cascading Dropdown In Laravel...?

I Need a Cascading Dropdown for my admin panel, where the dropdown values come from database. [[ example: https://prnt.sc/lccqc4 ]] I need to be work like this: https://prnt.sc/lccq7o

When I select Route no, the values of other dropdown will show related pickpoint names of that selected route. This is my ajax code I have written in php file (app-admin.blade.php):


$(document).ready(function() {

    $(document).on('change', '.selectRouteNo', function() {

        var route_id = $(this).val();
        var div = $(this).parent();

        var op = " ";

        $.ajax({
            type: "GET",
            url: '{!!URL::to(' / admin / allteacher / create / ')!!}',
            data: {
                'id': route_id
            },
            dataType: "JSON",
            success: function(data) {
                alert('Data Found');
                op += '<option value="0" selected disabled>Select Pick Point</option>';
                for (var i = 0; i < data.length; i++) {
                    op += '<option value="' + data[i].id + '">' + data[i].stoppagePoint + '</option>';
                }


                div.find('.stoppagePoint').html(" ");
                div.find('.stoppagePoint').append(op);
            },
            error: function() {
                alert('Data Not Found');
            }
        });
    });
});

My controller is like that:


    public function create(){
        return view('allteacher.create')
            ->with('allRoutes', AllRoute::all())
            ->with('allDepartments', AllDepartment::all());
    }

    public function findRouteById($id){
        $data=Product::select('routeNo','id')
            ->where('stoppagePoint',$request->id)
            ->get();

        return response()->json($data);
    }

This Is My Create (DropDown Form) Page:


<div class="col-md-4">
    <div class="fire_select2 fire_select">
        <label>Route No</label>
        <select name="routeNo" id="selectRouteNo" class="selectRouteNo" required>
            <option value="">Select Route No.</option>
            @foreach($allRoutes as $route)
                <option value="{{ $route->routeNo }}">{{ $route->routeNo }}</option>
            @endforeach
        </select>
    </div>
</div>
<div class="col-md-4">
    <div class="fire_select2 fire_select">
        <label>Pick Point</label>
        <select name="pickPoint" id="selectPickPoint" class="routeClass" required>
            <option value="">Select Pick Point</option>
        </select>
    </div>
</div>

30 Oct
9 months ago

nikhil_lu210 left a reply on How Can Show The Encrypted Password In My View Page As Decrypted Value?

@D9705996

This is my code for password Encryption:


function generateRandomString($characters) {
    $length = 6;
    $charactersLength = strlen($characters);
    $randomString = '';
    for ($i = 0; $i < $length; $i++) {
        $randomString. = $characters[rand(0, $charactersLength - 1)];
    }
    return bcrypt($randomString); //This will return encrypted password
}


nikhil_lu210 left a reply on How Can Show The Encrypted Password In My View Page As Decrypted Value?

@cmdobueno & @jlrdw I know this is wrong but my concept is different. For better security... In a university there is a lots of student. everybody has a unique ID (provided by university). Now if they want to create login, anybody can create an account with anyones ID. Now my concept is, "the Admin will input the ID range. Based on that every ID will get individual random passwords.

Suppose Admin gives a range 101001 - 101010. now all the ID betweer this range will generate besides a random password will generate individually for that ID's.. Now the Student's will collect their Password's from admin for login. Then they login and will change their password latter...

Data Input: https://prnt.sc/lcbk2a

Database: https://prnt.sc/lcbkgm

nikhil_lu210 started a new conversation How Can Show The Encrypted Password In My View Page As Decrypted Value?

I have generated multiple numbers of password for students. And I have kept those in database as studentPassword. now want to view the encrypted password list in my view page table as decrypted value. Suppose, in the database table there is a password 123456. But it's in encrypted formation. So how code I show the Decrypted value 123456 in my view page table row...?

12 Oct
10 months ago

nikhil_lu210 started a new conversation Dependent / Cascading Dropdown For Multiple ( Model, Migration-Table & Controller)

I have two migration table in a database named "2018_09_26_152831_create_all_drivers_table" & "2018_09_26_141623_create_all_routes_table". There are different model ( "AllDriver.php" & "AllRoute.php") and controller ( "AllDriverController.php" & "AllRouteController.php" ) for these two different table. There is also another migration table named "2018_09_26_144829_create_all_buses_table". For this table, I also have a similar model & controller too. In the "allbus.create" page I have two dropdown field named "Select Route" and "Select Driver". Here I want to get the Driver Name on behalf of selecting route no.

So can anyone please tell me the process, how can I build it successfully using Ajax or something else..?

01 Oct
10 months ago

nikhil_lu210 left a reply on How To Get Value/Data In Dropdown Options, That I Have Inserted Into Table...?

@Cronix I have Already been tried this one also... But same error... :(

nikhil_lu210 left a reply on How To Get Value/Data In Dropdown Options, That I Have Inserted Into Table...?

This is my AllBusController:

public function index() {

return view('allbus.index') - > with('allbuses', AllBus::all());

}

public function create() {

return view('allbus.create');

}

public function store(Request $request) {

$this - > validate($request, [
    'busNo' => 'required',
    'routeNo' => 'required',
    'driverName' => 'required'

]);

$busStore = AllBus::create([

    'busNo' => $request - > busNo,
    'routeNo' => $request - > routeNo,
    'driverName' => $request - > driverName

]);

return redirect() - > route('allbuses');

} public function show($id) {

$findBus = AllBus::find($id);
return view('allbus.show') - > with('allbus', $findBus);

}

public function update(Request $request, $id) {

$this - > validate($request, [
    'busNo' => 'required',
    'routeNo' => 'required',
    'driverName' => 'required'

]);

$allbus = AllBus::find($id);
$allbus - > busNo = $request - > busNo;
$allbus - > routeNo = $request - > routeNo;
$allbus - > driverName = $request - > driverName;
$allbus - > save();
return redirect() - > back();

}

public function destroy($id) {

$allbus = AllBus::find($id);
$allbus - > delete();
return redirect() - > route('allbuses');

} }

nikhil_lu210 left a reply on How To Get Value/Data In Dropdown Options, That I Have Inserted Into Table...?

@ouhare This is my AllRouteController:

public function index() {

return view('allroute.index') - > with('allroutes', Allroute::all());

} public function store(Request $request) {

$this - > validate($request, [
    'routeNo' => 'required',
    'totalStoppage' => 'required',
    'totalStudent' => 'required',
    'totalTeacher' => 'required'

]);
$routeStore = AllRoute::create([

    'routeNo' => $request - > routeNo,
    'totalStoppage' => $request - > totalStoppage,
    'totalStudent' => $request - > totalStudent,
    'totalTeacher' => $request - > totalTeacher

]);

return redirect() - > route('allroutes');

}

nikhil_lu210 left a reply on How To Get Value/Data In Dropdown Options, That I Have Inserted Into Table...?

@udaya

I have the different controller for route and bus. I create a route (with route no) in AllRouteController. Now I want to add a new bus. in allbus.create file I put a dropdown field so that I can get all the route no which I created into my allroute.create.... Now please simply tell me, how can I get those values from allroutes to my allbus.create files dropdown list...??

nikhil_lu210 left a reply on How To Get Value/Data In Dropdown Options, That I Have Inserted Into Table...?

@udaya Sorry, but I didn't understand your solution... :(

nikhil_lu210 left a reply on How To Get Value/Data In Dropdown Options, That I Have Inserted Into Table...?

@ouhare Yes.

I have passed my $allbus variable into this way:

@foreach($allbuses as $allbus)

<select name="routeNo" id="" class="{{ $errors->has('routeNo') ? ' is-invalid' : '' }}" required>
    <option value="">Select Route No.</option>
    <option value="{{ $allbus->routeNo }}">{{ $allbus->routeNo }}</option>
</select>

@endforeach

nikhil_lu210 started a new conversation How To Get Value/Data In Dropdown Options, That I Have Inserted Into Table...?

This is my code from allbus.create file:

Route No.
    <select name="routeNo" id="" class="{{ $errors->has('routeNo') ? ' is-invalid' : '' }}" required>
        <option value="">Select Route No.</option>
        <option value="01">01</option>
        <option value="02">02</option>
        <option value="03">03</option>
        <option value="04">04</option>
    </select>

    @if ($errors->has('routeNo'))
    <span class="invalid-feedback" role="alert">
              <strong>{{ $errors->first('routeNo') }}</strong>
    </span> 
@endif 

</div>

Now I want to get values from the database table where I have inserted Route No. from allroute.create file.

I Have tried to get those values in this way:

Route No.
    <select name="routeNo" id="" class="{{ $errors->has('routeNo') ? ' is-invalid' : '' }}" required>
        <option value="">Select Route No.</option>
        <option value="{{ $allbus->routeNo }}">{{ $allbus->routeNo }}</option>
    </select>

    @if ($errors->has('routeNo'))
    <span class="invalid-feedback" role="alert">
          <strong>{{ $errors->first('routeNo') }}</strong>
    </span> 
@endif 

</div>

But I get this error:

"Undefined variable: allbus (View: C:\laragon\www\tManagement\resources\views\allbus\create.blade.php)"

Can anyone tell me the process properly...?

26 Sep
10 months ago

nikhil_lu210 started a new conversation Multi Authentication Problem

I am working on a project where I have created Multi Authentication. Admin, Teacher & Student Panel. by the command of "php artisan make:auth" I have created the student authentication. And then I have duplicate all the files of auth related and customise them into two more authentications... now I wanna show the name of user (Student / Teacher / Admin) in the dashboard... in the student panel Dashboard I wrote "{{ Auth::user()->name }}" and its working... but in the teacher and admin is not working with this code... its showing error like this: "Trying to get property of non-object (View: C:\laragon\www\tManagement\resources\views\layouts\app-teacher.blade.php) (View: C:\laragon\www\tManagement\resources\views\layouts\app-teacher.blade.php)"

What can I do...??