iNemesis247

iNemesis247

Member Since 1 Year Ago

Experience Points 760
Experience
Level
Lessons Completed 0
Lessons
Completed
Best Reply Awards 0
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.

10 Mar
9 months ago

iNemesis247 started a new conversation ReactJS Build Components

How do i get this to work?

createElements(o) {
        const element = (
            <ExpansionPanel>
                <ExpansionPanelSummary>
                    title
                </ExpansionPanelSummary>
                <ExpansionPanelDetails>
                    text
                </ExpansionPanelDetails>
            </ExpansionPanel>
        );
        for(let i = 0; i < o.length; i++) {
            document.getElementById('depository').append(element);
        }
    }

So far i got printed on my screen [object Object]

28 Dec
11 months ago

iNemesis247 left a reply on Laravel Files Request Error

@shez1983 how do i roll back to 7.1 on homestead ?

iNemesis247 started a new conversation Laravel Files Request Error

I have a form :

<form action="/savePosts" method="POST" enctype="multipart/form-data">
        {{ csrf_field() }}
        <input type="file" name="files[]" multiple required>
        <button class="btn waves-effect waves-light red" type="submit" name="submit">Δημοσίευση</button>
</form>

Then i have a controller :

namespace App\Http\Controllers;

use File;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Http\Requests\UploadRequest;
use Illuminate\Support\Facades\Storage;

class savePosts extends Controller
{
    public function index (UploadRequest $request) {
        ini_set('memory_limit', '1024M');
        foreach($request->fs as $file) {
                // Do something here
            }
    }
}

And finally the UploadRequest.php file :

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class UploadRequest extends FormRequest
{
    /**
    * Determine if the user is authorized to make this request.
    *
    * @return bool
    */
        public function authorize()
        {
            return true;
        }

        /**
        * Get the validation rules that apply to the request.
        *
        * @return array
        */
    public function rules()
        {
            $files = count($this->input('files'));
            foreach(range(0, $files) as $index) {
                    $rules['files.' . $index] = 'file|mimes:jpeg,png,mpeg,mpga,mp3,mp4,doc,docx,odt,rtf,xls,xlsx,ods,ppt,pptx,odp,txt,pdf|max:10000000000';
            }
            return $rules;
        }
}

But whenever i submit the form i get this error :

count(): Parameter must be an array or an object that implements Countable

What am i doing wrong ?

16 Dec
11 months ago

iNemesis247 left a reply on Laravel/Homestead Database

@petrit Well first i want to define something. Do i need to install MySQL server 5.7 or just apache's installation of MySQL ?

iNemesis247 started a new conversation Laravel/Homestead Database

So i installed homestead and configured my .env file for a connection to my database. I set up a MySQL connection for homestead as i found on a YouTube tutorial. Then i migrated the database and when i opened MySQL workbench the database's tables were there. When i try to make a query to that database i get SQLSTATE[HY000][1045] Access denied for user 'user'@'localhost' (using password:YES) . Does that make any sense? I mean, the migration succeeded with no errors etc and access is denied when i try to make a query?

06 Nov
1 year ago

iNemesis247 left a reply on Custom Javascript Image Modal!

@mushood Thank you so much !!

05 Nov
1 year ago

iNemesis247 started a new conversation Custom Javascript Image Modal!

I created a custom image modal for a gallery i have.

@foreach($file as $image)
    <a onclick="previewImage('{{ $image }}')">
        <img class="thumbnail" src="{{ $image }}">  
    </a>
@endforeach

That is the modal i made.

<div id="imageBox" class="imageBox">
    <div class="content">
        <div class="body">
            <img id="im2prev" style="max-height:90vh;max-width:100%" src="" alt="">
        </div>
        <div class="foot">
        
        </div>
    </div>
</div>

And that is the javascript code for opening up modal.

function previewImage(image){
        var imageBox = document.getElementById('imageBox');
        var src = document.getElementById('im2prev');
        src = image;
        imageBox.style.display = "block";
    }
    window.onclick = function(event) {
        if (event.target == imageBox) {
            imageBox.style.display = "none";
        }
    }

Now i need to have a Next / Previous button at the modal's .foot. But how am i going to point on which image is the next and the previous one ?

04 Nov
1 year ago

iNemesis247 left a reply on Storage Limit Returns!

@robrogers3 Yes. I know how to keep track of things like that. I just didn't know if it was possible somehow. But since there is a way through my database i will go with it. So thank you for your time. I really appreciated it!

iNemesis247 left a reply on Storage Limit Returns!

@robrogers3 Yes i do store files' attributes to database and sounds like a good idea. I'll try it and let you know. But what do you mean by doing 10 at a time as the user scrolls?

iNemesis247 left a reply on Storage Limit Returns!

@robrogers3 Hahaha so i guess it's not possible yet !

iNemesis247 started a new conversation Storage Returns!

So i wanted to create an infinite scroll in a laravel project.

So far i have Storage::disk('s3')->allFiles(pathToFiles); and it works fine. But i need something like SELECT * FROM 'table' LIMIT 10,0 so the next time someone scrolls down it will be SELECT * FROM 'table' LIMIT 10,10 . Is something like that possible with Storage... ? I found nothing on Laravel's documentation.

Thanks!

26 Oct
1 year ago

iNemesis247 started a new conversation Storage All Files Issue

I have a folder called "Images" and inside it a folder called "thumbs".

If i do Storage::disk('s3')->allFiles('Images') it returns even the images stored inside "thumbs".

How can you handle this ? i want to get only the images inside "Images" folder.

25 Oct
1 year ago

iNemesis247 left a reply on Call A Method Inside The Same Method!

@martinbean Well there is a gallery with images and folders. This class is used to delete the images, but when it comes to deleting the whole folder i need to check if the incoming request is a folder and not an image. If this is true then call the function to delete the images inside a foreach.

iNemesis247 started a new conversation Call A Method Inside The Same Method!

Is this possible ?

<?php

namespace App\Http\Controllers;

class ThisClass extends Controller
{
    public function ThisFunc($thisParam)
    {
        if($something == true){
            ThisFunc(true);
        }
    }
}

?>

So far the above code is not working.

08 Oct
1 year ago

iNemesis247 left a reply on Tasks Running In Background

@ftrillo I'll check this and see if i can get anything out of it. Thanks for your reply

iNemesis247 started a new conversation Tasks Running In Background

I don't know if it makes any sense, but i will give an example so us to make it clear. Let's say i want people that uses my website, to be able to upload gigas of data. Can i catch this event and run it in the background while the user navigates through the website doing other stuff? So far when i upload a 1gb file (using ajax), if i refresh or go to another page the upload is interrupted. I believe it is possible but i need help on what needs to be done.

07 Oct
1 year ago

iNemesis247 left a reply on Ajax Upload Files / Progress Bar

@Dry7 Thank you. Really appreciated it.

iNemesis247 started a new conversation Ajax Upload Files / Progress Bar

Hello. I want to create a nice upload UI and i need help. So far i use ajax for uploading and my code is :

app.js

var form = document.getElementById('upload');
var request = new XMLHttpRequest();

form.addEventListener('submit', function (e) {
    e.preventDefault();
    var formdata = new FormData(form);
    request.open('post', '/upload');
    request.addEventListener("load", transferCompleted);
    request.send(formdata);
});

function transferCompleted(data){
    console.log('Upload Completed');
}

UploadRequest.php (Where i check mimes etc)

// Rules method
public function rules()
    {
       // Check mimes
        return $rules;
    }
}

and finally UploadFilesController.php

...
// Routed method uploadSubmit
public function uploadSubmit(UploadRequest $request)
{
    // Store Files
    return view('thisview', $aMessage);
}

All i want now is to set a simple progress bar to proceed further building a nice UI. Any suggestions on how you do this ?

Thanks.
05 Oct
1 year ago

iNemesis247 started a new conversation Preview Word, Excel And Powerpoint Documents.

I'm new to Laravel and i'm currently trying to figure out how things work. So far so good (credits to the awesome Laravel documentation). So this is a more general question, than PHP/Laravel. I uploaded docs to my laravel project. Word, Excel, Powerpoint and PDF. So foreach file, i have

<a href="path/to/doc">
    <iframe src="path/to/doc"/>
</a>

When i click the PDF file it opens up nicely to preview. But for Word, Excel, Powerpoint (office) that won't happen. Instead when the page loads or when i press upon the link, the download window pops up. After hours of digging i found the PHPOffice Library but after reading the description i'm not sure that it could do what i want. So my question is, is there any PHP/Laravel library/extension/tool or whatever so as to nicely preview office documents in the browser like PDFs ?

Thanks in advance!

25 Sep
1 year ago

iNemesis247 left a reply on Laravel Routing, Getting Anything Behind A Slash!

Both said the same thing. It worked. Thank you for your time !!

iNemesis247 left a reply on Laravel Routing, Getting Anything Behind A Slash!

@ejdelmonico Yes i've tried asterisk but returns the "Page Not Found"

iNemesis247 started a new conversation Laravel Routing, Getting Anything Behind A Slash!

I'm new in Laravel although i've been using PHP quite a while. I searched this question everywhere but didn't get any answer.

Is it possible to have something like this?

Route::get('[IF exists, get anything before this slash ->]/view/{var}', function ($var) { $data = array('variable'=>$var); return view('thisview'); });