amitshrestha221

Web Developer at Peace Nepal DOT Com

Experience

7,970

2 Best Reply Awards

  • Member Since 1 Year Ago
  • 12 Lessons Completed
  • 0 Favorites

17th May, 2018

amitshrestha221 started a new conversation Blank White Screen On Invalid Route. • 4 days ago

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.

22nd April, 2018

amitshrestha221 left a reply on Global Blur Event For Every Input • 4 weeks ago

In the master layout script,



$(function(){

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

});



Sorry if I misunderstood your question.

9th April, 2018

amitshrestha221 started a new conversation Urgency Of Laravel Permissions • 1 month ago

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.

13th March, 2018

amitshrestha221 started a new conversation Excel Sheet Validation • 2 months ago

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.

15th February, 2018

amitshrestha221 started a new conversation Laravel Queue • 3 months ago

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

7th February, 2018

amitshrestha221 started a new conversation Mysql Version Issue. • 3 months ago

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.

19th December, 2017

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

I changed it in RouteServiceProvider.php. Thanks

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

@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 • 5 months ago

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 • 5 months ago

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?

2nd December, 2017

amitshrestha221 left a reply on Globally Load Class.. • 5 months ago

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

amitshrestha221 left a reply on Globally Load Class.. • 5 months ago

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

amitshrestha221 started a new conversation Globally Load Class.. • 5 months ago

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.

30th November, 2017

amitshrestha221 started a new conversation Migrating From Laravel 4.2 To 5.5 (Authentication Error) • 5 months ago

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.

21st November, 2017

amitshrestha221 left a reply on Migrating Laravel Project • 5 months ago

@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 left a reply on Migrating Laravel Project • 6 months ago

@tisuchi @willvincent @TaylorOtwell @JeffreyWay @JeffreyWayTest @bobbybouwmann @Snapey

Hello sir, can you please cast some solution to my problem.

amitshrestha221 started a new conversation Migrating Laravel Project • 6 months ago

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.

22nd October, 2017

amitshrestha221 left a reply on Split Assets Backend And Frontend • 6 months ago

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

9th October, 2017

amitshrestha221 started a new conversation Merge Cells In Laravel Excel Export. • 7 months ago

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);


25th September, 2017

amitshrestha221 left a reply on Understanding About Helper. • 7 months ago

@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. • 7 months ago

@edoc just a curiosity.

amitshrestha221 left a reply on Understanding About Helper. • 7 months ago

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

amitshrestha221 started a new conversation Understanding About Helper. • 7 months ago

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.

3rd September, 2017

amitshrestha221 left a reply on Use Ip After Using Valet. • 8 months ago

@tisuchi

sir I tried to implement by this link :

[https://laracasts.com/discuss/channels/general-discussion/step-by-step-guide-to-installing-socketio-and-broadcasting-events-with-laravel-51]

All went fine, I just cannot access/ping my server:port

amitshrestha221 left a reply on Use Ip After Using Valet. • 8 months ago

@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. • 8 months ago

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

31st August, 2017

amitshrestha221 started a new conversation Auth Returning False. • 8 months ago


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.

23rd August, 2017

amitshrestha221 started a new conversation About Open Street Maps • 8 months ago

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 • 8 months ago

@vandyczech try the above solution please..

amitshrestha221 left a reply on Session Flash Message Not Working After Redirect Route • 8 months ago

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 • 8 months ago

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

amitshrestha221 left a reply on Looking For OSM Package? • 8 months ago

Does the geotools work with google maps or OSM?

amitshrestha221 started a new conversation Looking For OSM Package? • 8 months ago

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

Regards, A fellow developer.

26th July, 2017

amitshrestha221 started a new conversation Test • 9 months ago

test

6th June, 2017

amitshrestha221 started a new conversation Urgent Solution Required, Paginate Giving Issue. • 11 months ago

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.

18th May, 2017

amitshrestha221 left a reply on Get Laravel 5 DD In Laravel 4 • 1 year ago

@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 • 1 year ago

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

21st April, 2017

amitshrestha221 left a reply on Blackist Mime • 1 year ago

@bobbybouwmann what if i wanter all mimes except exe?

amitshrestha221 started a new conversation Blackist Mime • 1 year ago

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

6th April, 2017

amitshrestha221 started a new conversation Get Rows On The Basis Of Response_id • 1 year ago



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 • 1 year ago



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 • 1 year ago

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.

21st March, 2017

amitshrestha221 started a new conversation MYSQL Not Working In Shared Hosting.. • 1 year ago

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.

20th March, 2017

amitshrestha221 started a new conversation MYSQL Not Working In Shared Hosting.. • 1 year ago

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.

16th March, 2017

amitshrestha221 started a new conversation Get Form Value In Get Url • 1 year ago

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>


13th March, 2017

amitshrestha221 left a reply on Currency Conversion • 1 year ago

@ri7nz but currency conversion is only available in premium account.. I need something like convert a currency to USD from currencyCode

like NPR to USD

amitshrestha221 left a reply on Currency Conversion • 1 year ago

@ri7nz i think your site does it.

amitshrestha221 left a reply on Currency Conversion • 1 year ago

I wanted something like.. pass the country code and your price and convert it to USD My application renders price on the basis of country code..

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.