rossiluca

rossiluca

Fullstack Developer at Prysma

Member Since 5 Months Ago

Pordenone

Experience Points
7,430
Total
Experience

2,570 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
47
Lessons
Completed
Best Reply Awards
4
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    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 Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 2
7,430 XP
Jan
05
2 weeks ago
Activity icon

Awarded Best Reply on Run If Statement Inside @click

Where are you trying to add the @clickevent?

Anyway you can set a method on the @clickevent like this:

@click="setIndexLoop"

Then in methods define it:

methods: {
  setIndexLoop() {
    if(this.indexLoop > this.recipes.length) {
    this.indexLoop = 0;
    } else {
    this.indexLoop++;
   }
}

If indexLoop and recipesar not defined on your data or as a props, you can pass it to the function

Activity icon

Replied to Run If Statement Inside @click

Where are you trying to add the @clickevent?

Anyway you can set a method on the @clickevent like this:

@click="setIndexLoop"

Then in methods define it:

methods: {
  setIndexLoop() {
    if(this.indexLoop > this.recipes.length) {
    this.indexLoop = 0;
    } else {
    this.indexLoop++;
   }
}

If indexLoop and recipesar not defined on your data or as a props, you can pass it to the function

Jan
04
2 weeks ago
Activity icon

Awarded Best Reply on Can't Create Package With Laravel-packager

Ok it seems it's a problem with cURL SSL certificate. This can be solved by opening up your .env file and putting this in it:

CURL_VERIFY=false

Activity icon

Replied to Can't Create Package With Laravel-packager

Ok it seems it's a problem with cURL SSL certificate. This can be solved by opening up your .env file and putting this in it:

CURL_VERIFY=false

Jan
03
2 weeks ago
Activity icon

Started a new Conversation Can't Create Package With Laravel-packager

When I try to create a package with the command php artisan packager:new VendorName PackageNameit returns me this error:

 0/6 [>---------------------------]   0% Creating package VendorName\PackageName...
Creating packages directory...
Creating vendor...
Downloading skeleton...

   ErrorException  : Undefined index: extension

  at /Users/lucarossi/code/projectName/vendor/jeroen-g/laravel-packager/src/FileHandler.php:212
    208|      */
    209|     protected function getArchiveExtension($archiveFilePath): string
    210|     {
    211|         $pathParts = pathinfo($archiveFilePath);
  > 212|         $extension = $pathParts['extension'];
    213| 
    214|         // Here we check if it actually is supposed to be .tar.gz/.tar.xz
    215|         if (in_array($extension, ['gz', 'xz'])) {
    216|             $subExtension = pathinfo($pathParts['filename'], PATHINFO_EXTENSION);

  Exception trace:

  1   Illuminate\Foundation\Bootstrap\HandleExceptions::handleError("Undefined index: extension", "/Users/lucarossi/code/projectName/vendor/jeroen-g/laravel-packager/src/FileHandler.php", [])
      /Users/lucarossi/code/projectName/vendor/jeroen-g/laravel-packager/src/FileHandler.php:212

  2   JeroenG\Packager\Conveyor::getArchiveExtension()
      /Users/lucarossi/code/projectName/vendor/jeroen-g/laravel-packager/src/Conveyor.php:70

  Please use the argument -v to see more details.

How can I avoid this?

Dec
18
1 month ago
Activity icon

Replied to Download Image From S3 Bucket

Both the way returns a jfif text/file.

By the way i'm using Inertia.js if may helps

Dec
17
1 month ago
Activity icon

Started a new Conversation Download Image From S3 Bucket

Hi, I'm trying to download an image from my s3 bucket.

This is my code:

$assetPath = Storage::disk('s3')->url($url);
return readfile($assetPath);

But this return something like this:

����JFIF``��;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 90
��C




��C   

����"��  
���}!1AQa"q2���#B��R��br�  
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz���������������������������������������������������������������������������   
���w!1AQaq"2�B����   #3R�br�
�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������

I also tried to add headers:

header("Content-Description: File Transfer");
header("Content-Type: " . 'image/jpeg;');
header("Content-Disposition: attachment; filename=" . basename($assetPath));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
Dec
02
1 month ago
Dec
01
1 month ago
Activity icon

Replied to Which Features Are You Missing In Forums?

I'm just trying to build a laracasts like forum with some tips for fun

Activity icon

Started a new Conversation Which Features Are You Missing In Forums?

I'm doing a "poll"just to know which features do you think is missing in Laracasts, Stack Overflow, etc or what would you improve!

Just let me know

Nov
29
1 month ago
Activity icon

Awarded Best Reply on HasMany Relationship Doesn't Work In Laravel

Eloquent relationship may not work if the column is not set properly.

In the migration the type of the column gender_id must be a unsignedBigInteger

I suggest you also to rename the function in your User.php model to gender instead of genders

I saw you use gender_id when you create your user:

$user = User::create([
            'genders_id' => $genders,
            'name' => $data['name'],
            'email' => $data['email'],
            'age' => $data['age'],
            'password' => Hash::make($data['password']),
]);

This will actually not work because Laravel will search for gender_id in the table

If you want to keep genders_id you can set your hasMany like this: return $this->hasMany(User::class, 'genders_id');

Nov
28
1 month ago
Activity icon

Replied to How To Send Data From Laravel Controller To Vuejs

Updated, changed the path of the axios get

Activity icon

Replied to How To Send Data From Laravel Controller To Vuejs

Your routes in api.php should be something like this:

Route::get('user', '[email protected]');

And your axios.get should be call it like this:

 axios.get('/api/user')`
Activity icon

Replied to HasMany Relationship Doesn't Work In Laravel

Eloquent relationship may not work if the column is not set properly.

In the migration the type of the column gender_id must be a unsignedBigInteger

I suggest you also to rename the function in your User.php model to gender instead of genders

I saw you use gender_id when you create your user:

$user = User::create([
            'genders_id' => $genders,
            'name' => $data['name'],
            'email' => $data['email'],
            'age' => $data['age'],
            'password' => Hash::make($data['password']),
]);

This will actually not work because Laravel will search for gender_id in the table

If you want to keep genders_id you can set your hasMany like this: return $this->hasMany(User::class, 'genders_id');

Activity icon

Awarded Best Reply on Renaming Laravel Default Login Route Name "login"

Simply define the route you want something like this: Route::get('user_login')->name('login')->uses('Auth\[email protected]')

and make sure there is not Auth::routes(); declared

Activity icon

Replied to Renaming Laravel Default Login Route Name "login"

Simply define the route you want something like this: Route::get('user_login')->name('login')->uses('Auth\[email protected]')

and make sure there is not Auth::routes(); declared

Activity icon

Replied to How To Get The Latest Item By Id.

This way will keep the existing index order. Try this instead: ->sortByDesc('id')->values()

Nov
27
1 month ago
Activity icon

Replied to Loop Not Working

What's not working? Simply not looping or isn't pushing in the array?

Activity icon

Awarded Best Reply on Issue With Vuetify Not Working With Laravel

Add this import 'vuetify/dist/vuetify.min.css' after Vue.use(Vuetify);

Activity icon

Replied to Issue With Vuetify Not Working With Laravel

Add this import 'vuetify/dist/vuetify.min.css' after Vue.use(Vuetify);

Activity icon

Replied to Where Are You All From?

Pordenone, Italy

Sep
12
4 months ago
Activity icon

Replied to Php Artisan Serve

Run composer install

Sep
02
4 months ago
Activity icon

Replied to Image Not Display In Laravel 5.7

Yes you have to remove /public/ from the path saved in the db. If my answer resolved your problem mark it as best answer!

Activity icon

Replied to Image Not Display In Laravel 5.7

You're using the asset function which link to the public folder. If your images are stored inside the storage folder you can use the `php artisan storage:link" command to link your storage directory inside your public folder. So then you can use it as this:

{{ asset('storage/passports/no_image.jpg') }}

whithout also adding /public/ after /storage/

Activity icon

Replied to Image Not Display In Laravel 5.7

Can you show your view code?

Aug
30
4 months ago
Activity icon

Replied to InsertGetId In Transaction Did Not Fill Column Created_at

Make sure that in your Model timestamps are enable. Try to put this instead:

/**
  * Indicates if the model should be timestamped.
  *
  * @var bool
*/
public $timestamps = false;

Also make sure your timestamps are as default, instead you can specify the name as below:

<?php
class Flight extends Model
{
    const CREATED_AT = 'creation_date';
    const UPDATED_AT = 'last_update';
}
Aug
27
4 months ago
Activity icon

Replied to Using Laravel Passport With Vue.js

What about routes?

Aug
25
4 months ago
Activity icon

Started a new Conversation Using Laravel Passport With Vue.js

I followed the Taylor Guide on how to implement Passport auth in a Laravel app. Everything works fine but every guide i founded use Passport only using Blade and Laravel Web Routes. In my app i'm using Vue Router and i can't find how to secure my routes only for authenticated users.

This is how my code looks like

app.blade.php:

<html>
  <head>
    <!-- CSRF Token -->
      <meta name="csrf-token" content="{{ csrf_token() }}">
  </head>
  <body>
    <div id="app"></div>
    <script src="{{ asset('js/app.js') }}" defer></script>
  </body>
</html>

Then in my app.js:

const initialize = () => {
  if (!app) {
    app = new Vue({
      router,
      store,
      render: h => h(App)
    }).$mount('#app');
  }
};

router.js:

import Vue from 'vue'
import Router from 'vue-router'

import store from './store';
Vue.use(Router)

let router = new Router({
  mode: 'history',
  routes: [
    {
      path: '',
      name: 'home',
      component: () => import('./views/Home.vue')
    },
    {
      path: '/explore',
      name: 'explore',
      component: () => import('./components/Explore.vue')
    },
    {
      path: '/stock',
      name: 'stock',
      component: () => import('./components/Stock.vue')
    },
  ]
});

How to properly use Passport with Vue? I have to save access_token in my localstorage? I also read that if implemented Passport Auth then in Javascript there is no need to save any token because already save a laravel_token in cookies. Is it correct?

Thank you all

Jul
31
5 months ago
Activity icon

Started a new Conversation Use Variable Inside Another Variable In A Mail Blade View

I'm using the Mail library in Laravel to send html email with custom data passed to a blade view.

The problem born when the mail has to render the html fetched from a row in the database which include a variable that i pass through the view.

This is my build function in my mailable class

public function build()
{
   return $this->from('[email protected]')
     ->view('view')
     ->with([
       'url'     => 'https://google.com',
       'text' => $this->parameters->text,
      ]);
}

Then in the blade view:

<div>
  {!! $text !!}
</div>

This is what the $text variable looks like:

<p>
  <span>This is my text for the mail</span>
  <a href="{{ $url }}">Click here to compile</a>
</p>

The link href should contain the url variable value instead of not passing the variable name itself