tisuchi

Developer at EDV Standard

Hire Me

Experience

159,305

86 Best Reply Awards

  • Member Since 2 Years Ago
  • 1005 Lessons Completed
  • 12 Favorites

16th August, 2017

tisuchi left a reply on How Do Anchor Tag Behave Like A Button Submit And Get The Value In Controller? • 15 hours ago

Another idea can be, simply apply onclick jquery function on that link. Whenever anyone click on that, use Ajax to complete your work in PHP part.

tisuchi left a reply on Laravel With JQuery Count Timer • 1 day ago

Check there, how to use this.

https://github.com/narduz86/jquery-tinytimer

15th August, 2017

tisuchi left a reply on Laravel Default Session Content • 2 days ago

Normally in a fresh laravel, session table stores following information-

id
user_id
ip_address
user_agent
payload
last_activity

Ref: https://laravel.com/docs/5.4/session

tisuchi left a reply on How Do I Add A Class When The Button Is Clicked? • 2 days ago

Why not just use jQuery to solve this issue-

<button v-on:click="makeRed" id="mybutton">

and in your method,

makeRed: function() {
    $( "#mybutton" ).last().addClass( ".red" );    
}

tisuchi started a new conversation Laravel Search With Too Many Keywords • 2 days ago

I have around 30 default keywords to search from a table. What I have in my mind-

//fetching all the conversations ID from messages table based on all keywords

$ids = Message::where('user_id', '!=', 1)
            ->where(function($query){
                $query->where('message', 'LIKE', '%allowance%');
                $query->orWhere('message', 'LIKE', '%how much%')
                ......
        //30 more orWhere condition
            })
            ->groupBy('conversation_id')
            ->lists('conversation_id')->toArray();

//getting all conversations and loading messages as a lazy load
$convs = Conversation::with('Messages', 'Messages.userone', 'Messages.usertwo')
            ->whereIn('id', $ids)
            ->paginate(100);

I takes long time to load. I realized that, its not the ideal way to write this code. Of course, there are some other ways to solve this.

Any suggestion for that?

14th August, 2017

tisuchi left a reply on Does Lot's Of Small Queries Slow Downs The Search? • 2 days ago

May be you can install this plugin to see what is the differences-

https://packagist.org/packages/barryvdh/laravel-debugbar

tisuchi left a reply on Explode A String Into An Array With Assigned Value And Send The Email To Multiple Recipient With Recipient Name • 2 days ago

You may try this-

$allEmails = [email protected], [email protected], [email protected]';
$emails = explode(',', $allEmails);

$values = array('abc', 'cde', 'fgh');

array_combine($email, $values);


//output will be
/*
array:3 [▼
  "[email protected]"=> "abc"
  "[email protected]"=> "cde",
  "[email protected]"=> "fgh",
]
*/

tisuchi left a reply on Redirect To Dashboard • 2 days ago

Add those login in your methods-

in your join and registration, add this..

//for login / register page
if (Auth::check()) {
    return redirect()
            ->route('dashboard');
}

after successfully logged in, add this line of code-

//redirecting to Dashboard
return redirect()->intended('member');

tisuchi left a reply on Explode A String Into An Array With Assigned Value And Send The Email To Multiple Recipient With Recipient Name • 2 days ago

You may try this-

$a = array([email protected]'=>'abc',[email protected]'=>'cde');

foreach($a as $key => $value){
    mail->to($key, $value); 
}

Ref: http://php.net/manual/en/control-structures.foreach.php

11th August, 2017

tisuchi left a reply on How To Export Sublime Text Snippets To PhpStorm • 6 days ago

@fumi

Why not you just create another snippet in Phpstorm?

10th August, 2017

tisuchi left a reply on Sending Email From A Custom Email Address • 1 week ago

Yes, there is.

If you want to use mailgun, during sending email, just use [email protected]

Check it out mail documentation. https://laravel.com/docs/5.4/mail#writing-mailables

2nd August, 2017

tisuchi left a reply on How Can I Write MySQL Query In Laravel Controller? • 2 weeks ago

You can use DB::raw in order to write query.

Ref: https://laravel.com/docs/5.4/queries#raw-expressions

tisuchi left a reply on Laravel Blog Plugin • 2 weeks ago

You will get so many results. Just check it here- https://packalyst.com/packages/tag/blog

Or can check this https://github.com/InWave/laravel-blog

tisuchi left a reply on Boot Strape Add Hidden Button To Form,how To Prevent It? • 2 weeks ago

Instead of eliminating hidden button, just take off form validation!

tisuchi left a reply on How To Call A Function From Main Controller To Blade Without Passing On Compact • 2 weeks ago

Take is simple. If it is model related task, just call a specific model into blade.

{{ App\User::count() }}

27th July, 2017

tisuchi left a reply on I Have A 8 Queue Workers And They Sometimes Process The Same Job Which Causes Error. • 3 weeks ago

I feel, better you show your code.

26th July, 2017

tisuchi left a reply on MethodNotAllowedHttpException In RouteCollection.php (line 251) • 3 weeks ago

I think the way you define sort is not correct.

It should be sort() or sortBy() or sortByDesc().

Reference: https://laravel.com/docs/5.4/collections

tisuchi left a reply on How I Upgrade My Laravel V5.1 To V5.4? • 3 weeks ago

My opinion-

  • Download Laravel 5.4
  • Copy all of the model, controller & views
  • Copy composer file
  • Update composer

18th July, 2017

tisuchi left a reply on ErrorException In B63c09d29b399fbc952d50977553528f3a94ab78.php Line 23: Trying To Get Property Of Non-object (View: C:\project\resources\views\user\applicationForm\view.blade.php) • 4 weeks ago

In form, there is a space between -> and $applicationform.

The correct code is -

<form class="form-horizontal" method="POST" action=" viewApp&<?php echo $applicationform->id ?>" role="form">   {{csrf_field()}}

Instead of

<form class="form-horizontal" method="POST" action=" viewApp&<?php echo $applicationform ->id ?>" role="form">   {{csrf_field()}}  

17th July, 2017

tisuchi left a reply on Eloquent Relationship Via Email Field • 4 weeks ago

Can you show your relationship code?

tisuchi left a reply on Laravel 5.4 Trying To Get Property Of Non-object AdminMiddleware • 4 weeks ago

May be you can check first whether user()->level is exists or not?

if(!empty($request->user()->level)){
    if ($request->user()->level != 'admin')
    {
        return redirect('home');
    }
}

Or make sure that every user has level.

13th July, 2017

tisuchi left a reply on Laravel 5.4 Route List Command Exception • 1 month ago

Instead of showing

  [Symfony\Component\Debug\Exception\FatalErrorException]
  syntax error, unexpected '}'

Show your full lines of errors.

tisuchi left a reply on Laravel 5.4 Route List Command Exception • 1 month ago

So, it means, somewhere you put extra }. Check slowly and surely you can find it out.

tisuchi left a reply on Laravel 5.4 Route List Command Exception • 1 month ago

You need to generate encryption key before that.

Run

php artisan key:generate

and than use

php artisan route:list

tisuchi left a reply on How To Compare Date With Today Date To Know Whether The Date Is Greater Or Not? • 1 month ago

Follow @developre answer. Its easy with Carbon.

tisuchi left a reply on How To Compare Date With Today Date To Know Whether The Date Is Greater Or Not? • 1 month ago

Try simply this-

$date = new Carbon;
if($date > $product->expirey_date)
{
    //its already expired
} else {
    //stil to go 
}

11th July, 2017

tisuchi left a reply on Parse Error • 1 month ago

Better show your migration file.

7th July, 2017

tisuchi left a reply on Record Id In A List In Vue • 1 month ago

Can you pass record id inside vue function.

@click="addCategory(list.id)"

It should work.

tisuchi left a reply on Seeding Database; 'syntax Error, Unexpected 'funciton' (T_STRING), Expecting Variable (T_VARIABLE)' • 1 month ago

You have typo.

It should be function but you wrote funciton.

5th July, 2017

tisuchi left a reply on Parse Error: • 1 month ago

It could for many reasons. Check your

  • composer.json
  • web.php / routes.php
  • Controllers
  • Model

Surely you wrote something wrong there.

Ref: https://stackoverflow.com/questions/32312693/laravel-5-php-artisan-syntax-error https://laracasts.com/discuss/channels/general-discussion/cant-run-composer-command-because-of-an-error?page=0

tisuchi left a reply on (1/1) FatalErrorException Class 'App\Article' Not Found • 1 month ago

show your code after updating...

tisuchi left a reply on Generate Migration From Existing Database • 1 month ago

If I am in your positions, I would like to create db file manually, than create migration file and model.

tisuchi left a reply on (1/1) FatalErrorException Class 'App\Article' Not Found • 1 month ago

Instead of

$article=\App\Article::all(); 

Use

$article= Article::get();

tisuchi left a reply on Industry Standard For Admin Backend • 1 month ago

Honestly, it depends upon programmers.

However, many of them use /admin or /dashboard. Even some of them use /admin/dashboard to make it more secure.

tisuchi left a reply on Unable To Login Using Attempt Method • 1 month ago

May be you can use in bit different way-

Auth::attempt(['email' => $email, 'password' => $password]

BTW, make sure that you are storing right email and password info into variables.

2nd July, 2017

tisuchi started a new conversation Do You Like IViewUI • 1 month ago

Just now I discover VueJS based UI called iViewUI (https://www.iviewui.com)

How do you feel to use this for your next/existing project?

30th June, 2017

tisuchi left a reply on Laravel, What To Do Next? • 1 month ago

I love to implement after learning something new. You may build any small project by implementing whatever you learn from the series to prove that, you have understood all the things properly.

28th June, 2017

tisuchi left a reply on FirstOrCreate Doesn't Work With Some Attributes • 1 month ago

Can you show your full code?

23rd June, 2017

tisuchi left a reply on Laravel - Is It Possible To Learn It In A Few Weeks? • 1 month ago

haha... @teckel

May be you are too advanced on PHP!!!

You know what, we have learned a lot form this community. We are thankful for that..

22nd June, 2017

tisuchi left a reply on MethodNotAllowedHttpException • 1 month ago

What error you are getting now...

tisuchi left a reply on MethodNotAllowedHttpException • 1 month ago

Try changing your <form a bit-

<form action="posts" method="POST">
{{ csrf_field() }}

tisuchi left a reply on MethodNotAllowedHttpException • 1 month ago

Can you show your route?

tisuchi left a reply on Laravel Training • 1 month ago

Correct me, if I am wrong.

Doesn't laracast training enough for you to understand the concept of laravel as well as PHP?

Edit Your Profile
Update

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