Buy your loved one the ultimate gift. Lifetime gift certificates are $100 off.

amitshrestha221

Web Developer at Peace Nepal DOT Com

Experience

7,480

2 Best Reply Awards

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

2nd December, 2017

amitshrestha221 left a reply on Globally Load Class.. • 1 week ago

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

amitshrestha221 left a reply on Globally Load Class.. • 1 week ago

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

amitshrestha221 started a new conversation Globally Load Class.. • 1 week 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) • 2 weeks 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 • 3 weeks 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 • 3 weeks 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 • 3 weeks 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 • 1 month 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. • 2 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. • 2 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. • 2 months ago

@edoc just a curiosity.

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

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

amitshrestha221 started a new conversation Understanding About Helper. • 2 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. • 3 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. • 3 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. • 3 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. • 3 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 • 3 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 • 3 months ago

@vandyczech try the above solution please..

amitshrestha221 left a reply on Session Flash Message Not Working After Redirect Route • 3 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 • 3 months ago

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

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

Does the geotools work with google maps or OSM?

amitshrestha221 started a new conversation Looking For OSM Package? • 3 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 • 4 months ago

test

6th June, 2017

amitshrestha221 started a new conversation Urgent Solution Required, Paginate Giving Issue. • 6 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 • 6 months 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 • 6 months 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 • 7 months ago

@bobbybouwmann what if i wanter all mimes except exe?

amitshrestha221 started a new conversation Blackist Mime • 7 months 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 • 8 months 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 • 8 months 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 • 8 months 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.. • 8 months 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.. • 8 months 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 • 8 months 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 • 9 months 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 • 9 months ago

@ri7nz i think your site does it.

amitshrestha221 left a reply on Currency Conversion • 9 months 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..

amitshrestha221 left a reply on Currency Conversion • 9 months ago

fixer doesnt get response for Nepali Currency to USD .. :/

amitshrestha221 left a reply on Currency Conversion • 9 months ago

@ri7nz does it apply for any currency of any country?

amitshrestha221 started a new conversation Currency Conversion • 9 months ago

I want something like, convert a country's price to USD in current date's rate.

Is there any packages for it? Thanks in advance..

3rd March, 2017

amitshrestha221 left a reply on Laravel Mysql Driver • 9 months ago

but i have already completed my project in 5.3.. what should i do?

amitshrestha221 left a reply on Laravel Mysql Driver • 9 months ago

there is no php.ini in my ftp :( .. m sorry if m getting it wrong..

amitshrestha221 started a new conversation Laravel Mysql Driver • 9 months ago

Okay I have got two options in server : 5.6.3 or 7.0 I'm with laravel 5.3 which requires 5.6.4 minimum.. If i upload using 5.6.3, it wont be supported, and if I go with 7.0 the following error comes up :


QueryException in Connection.php line 770: could not find driver (SQL: select * from `ample_systemsettings` limit 1)


What should I do?

28th February, 2017

amitshrestha221 left a reply on URGENT Upgrade Mysql To 5.7 URGENT • 9 months ago

can i save the json field as Text? will there be any effect?

amitshrestha221 left a reply on URGENT Upgrade Mysql To 5.7 URGENT • 9 months ago

@tomi what should I do? I'm really tensed..

amitshrestha221 left a reply on URGENT Upgrade Mysql To 5.7 URGENT • 9 months ago

I have used json field for many important features in my project which is only available from mysql 5.7. What should I do?

amitshrestha221 started a new conversation Upgrade Mysql To 5.7 • 9 months ago

How to upgrade MySQL to 5.7 from cpanel?

Edit Your Profile
Update

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