pardeepkumar

pardeepkumar

Member Since 7 Months Ago

Experience Points 7,940
Experience
Level
Lessons Completed 0
Lessons
Completed
Best Reply Awards 10
Best Answer
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.

15 Nov
4 weeks ago

pardeepkumar left a reply on Larave Socialite Not Working On Production

@0099 Can you tell which hosting platform are you using ?

pardeepkumar left a reply on Multiple Image Upload

@sanjayacloud Kindly below code

public function uploadSubmit(Request $request)
 
{
 
$this->validate($request, [
 
'name' => 'required',
 
'photos'=>'required',
 
]);
 
if($request->hasFile('photos'))
 
{
 
$allowedfileExtension=['pdf','jpg','png','docx'];
 
$files = $request->file('photos');
 
foreach($files as $file){
 
$filename = $file->getClientOriginalName();
 
$extension = $file->getClientOriginalExtension();
 
$check=in_array($extension,$allowedfileExtension);
 
//dd($check);
 
if($check)
 
{
 
$items= Item::create($request->all());
 
foreach ($request->photos as $photo) {
 
$filename = $photo->store('photos');
 
ItemDetail::create([
 
'item_id' => $items->id,
 
'filename' => $filename
 
]);
 
}
 
echo "Upload Successfully";
 
}
 
else
 
{
 
echo '<div class="alert alert-warning"><strong>Warning!</strong> Sorry Only Upload png , jpg , doc</div>';
 
}
 
}
 
}
 
}

For storage

Laravel provides config/filesystems.php, located in the config folder. In this file, you can specify the locations for your file storage.

return [

'default' => 'local',

'disks' => [

'local' => [

'driver' => 'local',

'root' => storage_path('app'),

],

14 Nov
4 weeks ago

pardeepkumar left a reply on Multiple Image Upload

First try your view like

<form action="/multiuploads" method="post" enctype="multipart/form-data">
 
{{ csrf_field() }}
 
<div class="form-group">
 
<label for="Product Name">Product Name</label>
 
<input type="text" name="name" class="form-control"  placeholder="Product Name" >
 
</div>
 
<label for="Product Name">Product photos (can attach more than one):</label>
 
<br />
 
<input type="file" class="form-control" name="photos[]" multiple />
 
<br /><br />
 
<input type="submit" class="btn btn-primary" value="Upload" />
 
</form>

Controller

$items= Item::create($request->all());
 
foreach ($request->photos as $photo) {
 
$filename = $photo->store('photos');
 
ItemDetail::create([
 
'item_id' => $items->id,
 
'filename' => $filename
 
]);
 
}
 
echo "Upload Successfully";
 
}
 
else
 
{
 
echo '<div class="alert alert-warning"><strong>Warning!</strong> Sorry Only Upload png , jpg , doc</div>';
 
}
 
}
13 Nov
1 month ago

pardeepkumar left a reply on Why This Simple Email Validation Not Working?

You should try validation like

'email' => 'required|email',

or By Custom you should try

'custom' => [
    'email' => [
        'required' => 'We need to know your e-mail address!',
    ],
],
02 Oct
2 months ago
01 Oct
2 months ago

pardeepkumar left a reply on Quick Validation Question

I suggest you to try this article : Multiple File Uploading with Validation https://www.cloudways.com/blog/laravel-multiple-files-images-upload/

29 Sep
2 months ago

pardeepkumar started a new conversation Laravel 5.7 Features And Insatallation

Let's try Laravel 5.7 installation on Managed Cloud and their features

https://www.cloudways.com/blog/install-features-laravel-5-7/

28 Sep
2 months ago

pardeepkumar left a reply on Authenticating Users In Phpunit Testing

@elo i suggest you to try this article steps : Laravel Unit Testing

https://www.cloudways.com/blog/laravel-unit-testing/

pardeepkumar left a reply on Vue Pagination

I Suggest you to try this article steps : Laravel with Vue pagination https://www.cloudways.com/blog/vue-pagination-in-laravel/

26 Sep
2 months ago
25 Sep
2 months ago

pardeepkumar left a reply on Unit Testing Advice

i suggest you to read and follow this articles steps : Laravel Unit testing

https://www.cloudways.com/blog/laravel-unit-testing/

pardeepkumar left a reply on How To Simulate Real Hosting?

You should try Cloudways. They are manage hosting providers which makes it easy to create and manage dedicated servers on the choice of your infrastructure provider from (DigitalOcean, Vultr, Linode, AWS, GCE) . Every server you create with Cloudways comes with ThunderStack.

ThunderStack consist of Apache, NGINX , Varnish, Memcached, Redis, PHP-FPM , MySQL and MariaDB ThunderStack guarantees to make your websites 100x faster.

pardeepkumar left a reply on Laravel Api Rate Limiting Throttle, Increase Limit Greater Than 60

For disabling the rate limiter in Laravel, first go to the app/Http/Kernel.php. There you will find default throttle limit defined by Laravel for all api routes. Just comment out that code to disable it completely.

protected $middlewareGroups = [
...
'api' => [
'throttle:60,1',
],
];

For more information read this article https://www.cloudways.com/blog/laravel-and-api-rate-limiting/

24 Sep
2 months ago

pardeepkumar left a reply on How To Use Laravel Throttle

Route::middleware('auth:api', 'throttle:60,1')->group(function () {
Route::get('/user', function () {
//
});
});

for more information i suggest you should try this articles steps

https://www.cloudways.com/blog/laravel-and-api-rate-limiting/

pardeepkumar left a reply on Form Requests & WithValidator()

I suggest you to try this article

I have use Bootstrap classes for showing the alert for validation and use Laravel Validation methods to validate the type of file.

https://www.cloudways.com/blog/laravel-multiple-files-images-upload/

pardeepkumar left a reply on Laravel To Mobile App (Android/IOS Platform)

I suggest you to try this article steps How to Create and Connect Android App With Laravel API https://www.cloudways.com/blog/connect-android-app-with-laravel-api/

pardeepkumar left a reply on Develop Simple Android App Using The Laravel Login System.

i suggest you to try this articles steps How to Create and Connect Android App With Laravel API

https://www.cloudways.com/blog/connect-android-app-with-laravel-api/

18 Sep
2 months ago

pardeepkumar left a reply on Laravel 5.7 Upgrade Issues

Just check and read this official guide :

https://laravel.com/docs/5.7/upgrade

I also suggest you to try this articles steps : Laravel 5.7 installation process and features

https://www.cloudways.com/blog/install-features-laravel-5-7/

pardeepkumar left a reply on Laravel Command Returning Different Output When Executed By Cron On AWS EC2

I done this thing before by using Cloudways Managed Hosting check this article i think it helps you to solve your problem.

https://www.cloudways.com/blog/laravel-cron-job-scheduling/

17 Sep
2 months ago

pardeepkumar left a reply on Laravel 5.6 App Host On Live Server

I suggest you to try this article steps: Laravel 5.7 installation on Managed Cloud Hosting

https://www.cloudways.com/blog/install-features-laravel-5-7/

14 Sep
2 months ago
13 Sep
3 months ago

pardeepkumar left a reply on .env File

First apply this command

php artisan config:clear

If you face an issue related to installation or .env file i suggest you to try this articles steps

https://www.cloudways.com/blog/install-laravel-5-4-localhost/

pardeepkumar left a reply on Installing Discourse Forum With Laravel Forge

The Discourse software is written in Ruby and Javascript, using PostgreSQL as the main database, and Redis as a cache and for transient data. We will install Discourse under the Docker container.

I suggest you to try this article steps to install discourse forum :

https://www.howtoforge.com/tutorial/how-to-install-and-configure-discourse-forum-with-nginx-on-ubuntu-1604/

also if you don't have system administration knowledge or skills so you should try Managed Cloud hosting

pardeepkumar left a reply on Date Validation

I suggest you to try this articles steps for validation with File Uploading

https://www.cloudways.com/blog/laravel-multiple-files-images-upload/

10 Sep
3 months ago

pardeepkumar left a reply on Switch From Bluehost To Digital Ocean

I would recommend to also try Cloudways. It is one of the best Managed Laravel Hosting. It allows you to create servers on 6 cloud infrastructures including (DigitalOcean, Vult, Linode, AWS, GCE) .

Cloudways take cares of the hosting pain points of Laravel developers through the following features:

Server Cost is included in the Cloudways price plan. Hence developers only need a single account and receive a single invoice.

Easily deploy Laravel applications from Github or Bitbucket.

Auto deployment for Laravel applications.

Supervised Queue Management

Team Collaboration feature assigns server and application access and roles to the members of the team.

Easy server management features including server cloning and server transfer.

One click auto backup with frequency ranging from hourly to weekly.

Configure scheduled cron jobs with cron job manager

Pre-configured firewall and security

Monitor everything with the New Relic monitoring system.

Scale up servers with easy vertical scaling.

Pre-installed Composer and Git

24x7 live chat support by cloud professionals.

The best thing is you can try it for Free

pardeepkumar left a reply on Laravel Testing Issue

I suggest you to try to follow this articles steps :

https://www.cloudways.com/blog/laravel-unit-testing/

pardeepkumar left a reply on Admin Panel

i think you should try to use Laravel Voyager Admin its very easy to install

https://laravelvoyager.com/

pardeepkumar left a reply on How To Access Public Path Image

I suggest you to try something like that

Just put your Images in Public Directory (public/images_folder).

Let's suppose I stored images in public/images/Cloudways_logo.jpg.

View

<img src="{{url('/images/myimage.jpg')}}" alt="Image"/>

pardeepkumar left a reply on How To Create From Format With Timezone Using Carbon?

i suggest you to try like

$string = '2014-02-06 16:34:00';
$date = Carbon::createFromFormat('Y-m-d H:i:s', $string, 'US/..');
$date->setTimezone('UTC');
07 Sep
3 months ago

pardeepkumar left a reply on Retrieve Image From Storage

Let's Try

<img src="/ava/{{$filename}}" />

Routes

Route::get('/avatars/{filename}', function ($filename)
{
    $path = storage_path() . '/ava/' . $filename;

    if(!File::exists($path)));

    $file = File::get($path);
    $type = File::mimeType($path);

    $response = Response::make($file, 200);
    $response->header("Content-Type", $type);
    return $response;
})->name('ava');

also check for more information

https://www.cloudways.com/blog/laravel-multiple-files-images-upload/

06 Sep
3 months ago

pardeepkumar left a reply on Unable To Upload The Data To The Database (localhost)

The migrate:refresh command will roll back all of your migrations and then execute the migrate command. This command effectively re-creates your entire database:

php artisan migrate:refresh

// Refresh the database and run all database seeds...
php artisan migrate:refresh --seed

or 2nd method :

Delete tables from database and then again runphp artisan migrate command

pardeepkumar left a reply on How To Attach Multiple Images With Same Input Buttons

I suggest you to follow this article steps : Laravel file upload functionality with multiple file and image uploading option.

https://www.cloudways.com/blog/laravel-multiple-files-images-upload/

pardeepkumar left a reply on Insert Data From Android App To Remote MySQL Using Laravel As Backend.

One of the best ways to develop a robust backend for your android app is to use the Laravel API on a cloud that does most of the backend processing. Laravel has a solid codebase and provides optimized performance for all lightweight and enterprise level applications.

In this blog, I will first demonstrate you how to create a REST API with Laravel. Then afterwards, I will explain how to create an android app that will interact with the Laravel REST API.

i Suggest you to read and follow this article

https://www.cloudways.com/blog/connect-android-app-with-laravel-api/

pardeepkumar left a reply on How To Get Middleware Applied To A Request

A logging middleware might log all incoming requests to your application.

All of these middleware are located in the app/Http/Middleware directory.

public function handle($request, Closure $next)
    {
        if ($request->emp_age <= 200) {
            return redirect('homepage');
        }

        return $next($request);
    }
04 Sep
3 months ago

pardeepkumar left a reply on Upgrading Laravel 5.0 To 5.6

recommended method of upgrading is create a new Laravel 5.6 install and then to copy your 5.0 site's unique application files into the new application like your routes , controllers ,views .

you also check Laravel doc:

https://laravel.com/docs/5.0/upgrade#upgrade-5.0.16

03 Sep
3 months ago

pardeepkumar left a reply on Blog Application In Laravel 5 Tutorials

Resources for Laravel developers are everywhere.From official Documentation to personal development blogs, you could find a huge array of resources that cover Laravel for beginner and intermediate users.we have also covered several fringe Laravel tutorials for beginners, including installing Laravel on cloud, and Laravel security best practices. You will also find Laravel performance benchmark for PHP 5.6 and 7.x versions.

i suggest you to read this guide (Laravel tutorials for beginners) : https://www.cloudways.com/blog/laravel-tutorials-for-beginners/

pardeepkumar left a reply on Godaddy Hosting And Laravel

@nazar1987 Rename server.php in your Laravel root folder to index.php

Copy the .htaccess file from /public directory to your Laravel root folder.

Also if you face any problem to host your Laravel application i suggest you to try Cloud Hosting services. You can check Cloudways, They are providing manage hosting servers and DO is cheaper then Linode in their plan.

pardeepkumar left a reply on Laravel Deployment

Procedure for installing Laravel 5 on shared hosting

First connect to hosting via SSH

Second install composer then in cpanel open Select PHP version and choose 5.4. (I also set phar extension) then next, install laravel: php composer.phar create-project laravel/laravel myproject --prefer-dist

copy everything from myproject/public to public_html

open public_html/index.php and set:

require DIR.'/../myproject/bootstrap/autoload.php';

$app = require_once DIR.'/../myproject/bootstrap/start.php';

And on Cloud Hosting

Host you Laravel application on few steps

https://www.cloudways.com/blog/install-laravel-on-digitalocean/

pardeepkumar left a reply on Need To Make PDF Download In Laravel 4.2 Help!?

include first

<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.4.1/jspdf.debug.js" integrity="sha384-THVO/sM0mFD9h7dfSndI6TS0PgAGavwKvB5hAxRRvc0o9cPLohB0wb/PTA7LdUHs" crossorigin="anonymous"></script>

Then

<!DOCTYPE html>
<html>
  <body>
    <p id="ignorePDF">don't print this to pdf</p>
    <div>
      <p><font size="3" color="red">print this to pdf</font></p>
    </div>
  </body>
</html>

JavaScript code to open the created PDF

var doc = new jsPDF();          
var elementHandler = {
  '#ignorePDF': function (element, renderer) {
    return true;
  }
};
var source = window.document.getElementsByTagName("body")[0];
doc.fromHTML(
    source,
    15,
    15,
    {
      'width': 180,'elementHandlers': elementHandler
    });

doc.output("dataurlnewwindow");

pardeepkumar left a reply on Laravel Custom File-system Configuration

Try something like

Storage::disk('uploads') -> put($filename, file_get_contents($img -> getRealPath()));