amitshrestha221

amitshrestha221

Member Since 2 Years Ago

Bhaktapur, Nepal.

Web Developer at Peace Nepal DOT Com

Experience Points 8,090
Experience Level 2

1,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 12
Lessons
Completed
Best Reply Awards 2
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

29 May
1 year ago

amitshrestha221 left a reply on Directory Listing In Valet

I'm currently using

Nginx : 1.14.0 PHP : 7.0 Valet : 2.0.24

amitshrestha221 started a new conversation Directory Listing In Valet

I have installed valet-linux. It disables browsing other projects that I need by running


localhost/project


It displays Valet not found.

I tried


autoindex on;


in both valet and nginx configuration and restarted server. Still I cannot access the project using localhost/project.

21 May
1 year ago

amitshrestha221 left a reply on Valet, Can't Access Wordpress Admin Area

I am currently using valet, wordpress side by side. It is working fine while i access


xyz.xyz/wp-admin


Which valet version are you using?

17 May
1 year ago

amitshrestha221 started a new conversation Blank White Screen On Invalid Route.

Hello everyone,

My app was migrated from 4.2 to 5.5. All is working perfectly, the only issue I have is it shows white blank screen during invalid route.

Has anyone ever faced this issue? Suggest me some solution.

22 Apr
1 year ago

amitshrestha221 left a reply on Global Blur Event For Every Input

In the master layout script,



$(function(){

    $("input").blur(function(){
        // your action.
    });

});



Sorry if I misunderstood your question.

09 Apr
1 year ago

amitshrestha221 started a new conversation Urgency Of Laravel Permissions

Hello all,

We just got hacked and lost all our assets inside public folder which had 777 permission as well as folders inside storage were deleted. Can anyone please help us correct permission for laravel projects.

13 Mar
1 year ago

amitshrestha221 started a new conversation Excel Sheet Validation

Is there any way to render field validation for dynamically generated excel? I am using [https://github.com/Maatwebsite/Laravel-Excel]

eg : If i pass 75 max value to a field, the field must be less than 75 in the excel file.

15 Feb
1 year ago

amitshrestha221 started a new conversation Laravel Queue

Can someone provide me simple working example on email queues in Laravel.

07 Feb
1 year ago

amitshrestha221 started a new conversation Mysql Version Issue.

I am recently facing too many issues regarding mysql when upgrading from 5.6 to 5.7 in ubuntu server.


Issues I am facing are like:
> Default Value issue.
> Only Full Group By issue.

These type of error occurs randomly i.e. it comes sometimes whereas it may not come.

is there any way that I could force mysql to behave like 5.6

I have 200+ tables in my project, So, setting default value for all the tables would take a lot of time.

This code:


SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));


solves the issue of full group by but arise on a restart of the server.

19 Dec
1 year ago

amitshrestha221 left a reply on Taking App/http/routes.php Instead Of Routes/web.php After Migration

I changed it in RouteServiceProvider.php. Thanks

amitshrestha221 left a reply on Taking App/http/routes.php Instead Of Routes/web.php After Migration

@Snapey no sir there is no error. It doesn't effect anything even if i remove web.php. Routes is loading from routes.php. If i remove routes.php, it shows missing error.

Overall the project is running fine, I just wanted to shift my routes to web.php since it is the standard format now.

amitshrestha221 left a reply on Taking App/http/routes.php Instead Of Routes/web.php After Migration

yes at the beginning i had both files routes.php and web.php I copied contents from routes.php to web.php. I had both files, thought routes were loading from web.php Finally I deleted routes.php after some time and faced this issue. I have tried clearing, route, cache, view, config and dump autoload.

amitshrestha221 started a new conversation Taking App/http/routes.php Instead Of Routes/web.php After Migration

Hello everyone,

I sucessfully migrated a project from Laravel 4.2 to 5.5 which is currently on bug fixing phase. I have one issue, the routes is still loading from app/http/routes.php instead of routes/web.php.

Has anyone faced this situation?

02 Dec
1 year ago

amitshrestha221 left a reply on Globally Load Class..

can you please inform what will be the effect on the non-included classes.

amitshrestha221 left a reply on Globally Load Class..

Yes I guess I am using them in all the classes.

amitshrestha221 started a new conversation Globally Load Class..

How do I include libraries i.e.


use Session, Auth, etc....;


that will load for the whole app. I have migrated an old app with nearly 200 controllers. I would like to include them globally. Any help is thankful.

30 Nov
1 year ago

amitshrestha221 started a new conversation Migrating From Laravel 4.2 To 5.5 (Authentication Error)

I am migrating a project from 4.2 to 5.5. I have reached 5.3, I have taken backups for every successful version update 5.0, 5.1, 5.2. The problem is, after my 5.2 update, my authentication as working well and I was able to login to the system. However, after the 5.3 update, I am not able to login. I have followed all steps from official documentation for upgrading.


Auth::attempt()


returns false.

21 Nov
1 year ago

amitshrestha221 left a reply on Migrating Laravel Project

@bobbybouwmann I apologize about the tag, I will make sure it wont happen in the future. Well I'm about to go from scratch. Merge the unfinished features, but hide them in the view section. Once upgraded, will fork out the branches again so that development of the features can be done at their individual branches like before. I will write to you if I have any confusion. Thanks a lot for your support.

amitshrestha221 started a new conversation Migrating Laravel Project

Hello everyone, I have a project in Laravel 4.2.

I am about to migrate the Laravel version from 4.2 to latest. In the official doc from migrating to 4.2 to 5.0 (first), It says and I quote


" The recommended method of upgrading is to create a new Laravel 5.0 install and then to copy your 4.2 site's unique application files into the new application. "

The problem is I have unmerged branches (features that will not be completed soon so that I can merge it in master to carry the migration process ahead.). Is there any possible solution to handle this problem? I would also like to know the complications if I copy [.git] folder in the new 5.0 project directory.

22 Oct
1 year ago

amitshrestha221 left a reply on Split Assets Backend And Frontend

you can create separate folders inside public folder for user and admin assets.. :)

09 Oct
1 year ago

amitshrestha221 started a new conversation Merge Cells In Laravel Excel Export.

I am exporting excel like this. I ant the C field to be of 3 columns.


$array = ['A','B','C','D'];

$sheet->fromArray(array(
                    $array
                ), null, 'A1', false, false);


25 Sep
1 year ago

amitshrestha221 left a reply on Understanding About Helper.

@kenny11 no i meant for some data like retrieving notifications and messages in header, and other small queries, that can be called from a view for minor tasks.

amitshrestha221 left a reply on Understanding About Helper.

@edoc just a curiosity.

amitshrestha221 left a reply on Understanding About Helper.

@tomi @tisuchi @willvincent Sirs, I need your knowledge here please.

amitshrestha221 started a new conversation Understanding About Helper.

Suppose I call a helper method from a view file.

view :


@php $xyz =  Helper::getXYZ(); @endphp


In my helper file I have this method where I perform database queries:

helper:


public static function getXYZ(){
    $xyz = XYZ::all():
    return $xyz;
}


I would like to know if this breaking the flow of MVC pattern? Because we are running DB queries directly from helper method used in view file.

03 Sep
1 year ago

amitshrestha221 left a reply on Use Ip After Using Valet.

@tisuchi i am using ubuntu, forked version of valet.. My valet is working fine, I just don't know how to access my localhost or local IP.

my view file is following :


<script>
        //var socket = io('http://localhost:3000');
        var socket = io('http://127.0.1.1:3000');
        socket.on("test-channel:App\\Events\\EventName", function(message){
            // increase the power everytime we load test route
            $('#power').text(parseInt($('#power').text()) + parseInt(message.data.power));
        });
    </script>



I ran following socket


 node socket.js
Listening on Port 3000



it listens to port 3000 but I'm not being able to ping by following :


ping 127.0.0.1:3000
ping localhost:3000
ping project.dev:3000


amitshrestha221 started a new conversation Use Ip After Using Valet.

I am using valet since 7, 8 months. It is working fine. Today, I was about to test socket.io, so i made it listen to port 3000 i.e.


127.0.0.1:3000


But after using valet, my localhost is not accessible. I also tried to access it by using


project.dev:3000


still it is not accessible. By any chance can i access my ip or localhost ??

i tried pinging this is the output.


ping 127.0.0.1:3000

ping: unknown host 127.0.0.1:3000

31 Aug
1 year ago

amitshrestha221 started a new conversation Auth Returning False.


if (Auth::attempt(['email' => Input::get('email'),
                                'password' => Input::get('password'),
                                'user_type_id' => '2'])) {
                print_r(json_encode(['status' => 'success', 'value' => Auth::user()->id]));
                exit;
            }else{
                print_r(json_encode(['status' => 'error', 'value' => 'Sorry, credentials is not valid.'], JSON_PRETTY_PRINT));
                exit;
            }


The email and password is both correct still auth is returning false.

23 Aug
1 year ago

amitshrestha221 started a new conversation About Open Street Maps

Can anyone please help me integrate OSM in laravel from scratch? I am confused how to render multiple markers in view. Any tutorials will be welcome.

amitshrestha221 left a reply on Session Flash Message Not Working After Redirect Route

with() doesn't create session variable. It just prepares array to the view.

try


Session::flash('status','Message'); 

in controller

and



@if(Session::has('status')
{{ Session::get('status') }}
@endif


in view..

amitshrestha221 left a reply on Count And Get In Same Query

use DB:: raw in select to get custom count field in the output.

amitshrestha221 left a reply on Looking For OSM Package?

Does the geotools work with google maps or OSM?

amitshrestha221 started a new conversation Looking For OSM Package?

Is there any package built for Laravel for integrating Open Street Maps(OSM)?

Regards, A fellow developer.

26 Jul
1 year ago

amitshrestha221 started a new conversation Test

test

06 Jun
2 years ago

amitshrestha221 started a new conversation Urgent Solution Required, Paginate Giving Issue.

Whenever I perform

Model::paginate(10); ,

my browser gets frozen.

The same query

Model::get();, the data displays normally..

Firefox gets frozen and I am compelled to restart the laptop, whereas chrome shows

 *RECURSION*
 *RECURSION*


```  and then gets frozen in some minutes.

Please suggest me some answers.
18 May
2 years ago

amitshrestha221 left a reply on Get Laravel 5 DD In Laravel 4

@shakti there exists a dd() method but its weirder than var_dump() :D

amitshrestha221 started a new conversation Get Laravel 5 DD In Laravel 4

Is there any chance by which I can get DD feature of Laravel 5 in Laravel 4.

21 Apr
2 years ago

amitshrestha221 left a reply on Blackist Mime

@bobbybouwmann what if i wanter all mimes except exe?

amitshrestha221 started a new conversation Blackist Mime

How do we blacklist certain file types in mime validation. eg: blacklist .exe file type.

06 Apr
2 years ago

amitshrestha221 started a new conversation Get Rows On The Basis Of Response_id



id    response_id     name      ans
1             a1                 zz           test              
1             a1                 zz           test              
1             a1                 zz           test              
1             a2                 zz           test              
1             a2                 zz           test              
1             a2                 zz           test              


I want a1 values in one array and a2 values in another.. assuming there can be a3, a4 ...................

amitshrestha221 left a reply on Group By Returning Only One Column



id    response_id     name      ans
1             a1                 zz           test              
1             a1                 zz           test              
1             a1                 zz           test              
1             a2                 zz           test              
1             a2                 zz           test              
1             a2                 zz           test              


I want a1 values in one array and a2 values in another.. assuming there can be a3, a4 ...................

amitshrestha221 started a new conversation Group By Returning Only One Column

Database


FormResponses::where('form_id',$id)
                                ->select('form_id','question_id','response_id')
                                ->orderBy('response_id')
                                ->get()
                                ->toArray();



i have multiple records of same response_id, but the result is only one record of a id.

21 Mar
2 years ago

amitshrestha221 started a new conversation MYSQL Not Working In Shared Hosting..

I am working with Laravel 5.3 which required PHP 5.6.4. In my server there is only option for 5.6.3 or 7.0

When I select 5.6.3 using Multi PHP Manager in cpanel for the domain, mysql connection works and returns value when i wrote simple code for testing connection:


<?php

    $conn = mysqli_connect('localhost','amplesho_admin', '1#Ampleadmin', 'amplesho_ampleshop1') or die('Database Error');

    if($conn)
        echo "success";
    else
        echo "failed";

While selecting 5.6.3 it returns success. But when i select 7.0, it returns nothing. I'm on a shared hosting.

20 Mar
2 years ago

amitshrestha221 started a new conversation MYSQL Not Working In Shared Hosting..

I am working with Laravel 5.3 which required PHP 5.6.4. In my server there is only option for 5.6.3 or 7.0

When I select 5.6.3 using Multi PHP Manager in cpanel for the domain, mysql connection works and returns value when i wrote simple code for testing connection:


<?php

    $conn = mysqli_connect('localhost','amplesho_admin', '1#Ampleadmin', 'amplesho_ampleshop1') or die('Database Error');

    if($conn)
        echo "success";
    else
        echo "failed";

While selecting 5.6.3 it returns success. But when i select 7.0, it returns nothing. I'm on a shared hosting.

16 Mar
2 years ago

amitshrestha221 started a new conversation Get Form Value In Get Url

I want something like take the [var] and send it in url as get parameter..



<form method="get" action="{{ route('test.testURL') }}">
    <input type="text" name="var" value="var">    
</form>