Our Black Friday sale is now live! All individual subscriptions are 50% OFF. This week only!

felloz

felloz

Member Since 1 Year Ago

Experience Points
1,530
Total
Experience

3,470 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
1
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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 1
1,530 XP
Nov
23
2 days ago
Activity icon

Replied to 404 With Some ID's

Not even a semicolon give it to me so much headache /facepalm

Thank you!

Activity icon

Started a new Conversation 404 With Some ID's

Hello,

I have this route, but for some reason when the student id its 10 or higher I receive 404 error, but lower ID open correctly.

http://localhost/students_report/7 Good!

http://localhost/students_report/11 Error 404!

I checked the student with 11 id and already exist!

It's something wrong with my route?

//Students Report
Route::get('/students_report/{student}', '[email protected]')
    ->where('student', '[0-9+]')
    ->middleware('auth');

Laravel versión 8 upgraded from 6, 7, 8.

Note: I modified my Route Service Provider to keep old routes.

Nov
08
2 weeks ago
Activity icon

Replied to Laravel Mail: Set Sender And From

It's a technique used in Email Marketing Systems, you need to set up the DNS accordly to advise to ESP that you aren't doing phishing.

I have covered with PHPMailer, but im wondering if I can do the same with laravel, not for Mass Email sendings, I actually need it for only one email per sending process but with a different Email in Sender from From

Activity icon

Started a new Conversation Laravel Mail: Set Sender And From

Hello,

Wondering how can I set the sender and the from in laravel Mail. Similar to PHPMailer

This is an example from PHPMailer

$mail->Sender = '[email protected]';
$mail->setFrom([email protected]);

There is something similar in Laravel Mail?

Oct
27
4 weeks ago
Activity icon

Started a new Conversation Argon Dashboard: Pagination Looks Bad

Hi, I'm giving a try to Argon Dashboard, the Laravel Version https://www.creative-tim.com/product/argon-dashboard-laravel

But for some reason the Laravel pagination isn't working

Im trying 2 ways to do it but neither of those works:

<nav aria-label="...">
    <ul class="pagination pagination-lg">
		 {!! $emails->links() !!}
    </ul>
</nav>
<div class="d-flex justify-content-center">
	{!! $emails->links() !!}
</div>

This is the result that I'm receiving: https://i.imgur.com/voBktCZ.png

Anyone knows what I need to do to fix that?

Oct
19
1 month ago
Activity icon

Replied to Show API Content

Some people recommend me to use Laravel Swagger , but it seems too much for what I actually have.

The example view in my post I just builded with Bootstrap, VueJS, Highlightjs-vue and Laravel.

Oct
18
1 month ago
Activity icon

Started a new Conversation Show API Content

Hello, I'm looking for something ready to use for share or show how to consume some of my API.

This is an example of what I need:

https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.sheets/copyTo

Google use that nice feature to share examples to consume API there is something that I can use in my website in Laravel?

Oct
11
1 month ago
Activity icon

Awarded Best Reply on Upgrading To 8: Target Class [DatabaseSeeder] Does Not Exist.

There is need it only one change, I forgot to rename the folder seed to seeders.

Activity icon

Replied to Upgrading To 8: Target Class [DatabaseSeeder] Does Not Exist.

There is need it only one change, I forgot to rename the folder seed to seeders.

Activity icon

Started a new Conversation Upgrading To 8: Target Class [DatabaseSeeder] Does Not Exist.

Hello, I'm upgrading laravel 7 to 8 and now I'm trying to upgrade my factories, I made the changes required in the code, even in the composer.json but the seeder factory still dont work.

I'm receiving this error:

λ php artisan db:seed

   Illuminate\Contracts\Container\BindingResolutionException

  Target class [DatabaseSeeder] does not exist.

  at D:\isendWell\isendwell\vendor\laravel\framework\src\Illuminate\Container\Container.php:811
    807▕
    808▕         try {
    809▕             $reflector = new ReflectionClass($concrete);
    810▕         } catch (ReflectionException $e) {
  ➜ 811▕             throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
    812▕         }
    813▕
    814▕         // If the type is not instantiable, the developer is attempting to resolve
    815▕         // an abstract type such as an Interface or Abstract Class and there is

  1   D:\isendWell\isendwell\vendor\laravel\framework\src\Illuminate\Container\Container.php:809
      ReflectionException::("Class DatabaseSeeder does not exist")

  2   D:\isendWell\isendwell\vendor\laravel\framework\src\Illuminate\Container\Container.php:809
      ReflectionClass::__construct("DatabaseSeeder")

This is my factory code:

<?php

namespace Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;
use App\FakeSubscriber;
use Illuminate\Support\Str;


class FakeSubscribersFactory extends Factory
{
    protected $model = FakeSubscriber::class;

    public function definition()
    {
        return [
            'user_id' => 1,
            //'subscriber_email' => $faker->unique()->safeEmail,
            'subscriber_email'    => $this->faker->name . '@gmail.com',
            'subscriber_name'     => $this->faker->name,
            'subscriber_lastname' => $this->faker->lastName,
            'subscriber_phone'    => $this->faker->phoneNumber,
            'whatsapp_number'     => $this->faker->phoneNumber,
            'birth_date'          => now(),
            'optin'               => false,
            'double_optin'        => false,
            'custom_field1'       => Str::random(10),
            'custom_field2'       => Str::random(10),
            'custom_field3'       => Str::random(10),
            'custom_field4'       => Str::random(10),
            'is_deleted'          => false,
            'email_status'        => '1'
        ];
    }
}

My DatabaseSeeder.php

<?php

namespace Database\Seeders;

use App\FakeSubscriber;
use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {

        $this->call(Userlevel::class);
        $this->call(DomainsSeeder::class);
        $this->call(PlanSeeder::class);
        $this->call(UserSeeder::class);
        FakeSubscriber::factory(150)->create();

        // $this->call(FakeSubscriberSeeder::class);
    }
}

And my Model

<?php

namespace App;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class FakeSubscriber extends Model
{
    use HasFactory;
    protected $primaryKey = 'blabla_id';
    protected $table = "table";

    protected $fillable = [
     
	...
    ];
}

And the composer.json

 "autoload": {
        "psr-4": {
            "App\": "app/",
            "Database\Factories\": "database/factories/",
            "Database\Seeders\": "database/seeders/"
        }
    },

I used composer dump-autoload after the changes, but it didn't work

Oct
04
1 month ago
Activity icon

Started a new Conversation Laravel: Crayon Or Something Similar

Hello, im creating some api for my web app, but I need to show to my users some code examples to consume the apis.

Is there something to Laravel similar to crayon to show code examples that you can recommend me please?

Crayon site: https://github.com/aramk/crayon-syntax-highlighter

Sep
25
2 months ago
Activity icon

Replied to Double Click On Navbar Option = Logout

Just replaced this {{Auth::loginUsingId(auth()->user()->id)->gravatar}} with {{ auth()->user()->gravatar }} and problem solved.

Activity icon

Replied to Double Click On Navbar Option = Logout

I found the god damn problem and was this:

{{Auth::loginUsingId(auth()->user()->id)->gravatar}}

Why this is loggin me out?

Activity icon

Replied to Double Click On Navbar Option = Logout

I'm using auth()->user() to make some validations, to show items or not in the dashboard, but I don't think that could be that.

Activity icon

Replied to Double Click On Navbar Option = Logout

This is what i have in the header:

<meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <meta name="csrf-token" content="{{ csrf_token() }}">

    {{--<title>{{ config('app.name', 'Argon Dashboard') }}</title>--}}
    <title>{{ APP_NAME }} - @yield('title')</title>
    <!-- Favicon -->
    <link href="{{ asset('argon') }}/img/brand/favicon.png" rel="icon" type="image/png">
    <!-- Fonts -->
    <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet">
    <!-- Icons -->
    <link href="{{ asset('argon') }}/vendor/nucleo/css/nucleo.css" rel="stylesheet">
    <link href="{{ asset('argon') }}/vendor/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet">

    <!-- Argon CSS -->
    <link type="text/css" href="{{ asset('argon') }}/css/argon.css?v=1.0.0" rel="stylesheet">
    <link href={{ url("vendor/datatables/dataTables.bootstrap4.min.css") }} rel="stylesheet">
    <script src="https://cdn.tinymce.com/4/tinymce.min.js" referrerpolicy="origin"></script>
    <script src={{ url("vendor/chart.js/Chart.min.js") }}></script>

And this is what i have in the footer:

<script src="{{ asset('argon') }}/vendor/jquery/dist/jquery.min.js"></script>
<script src="{{ asset('argon') }}/vendor/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src={{ url("vendor/datatables/jquery.dataTables.js") }}></script>
<script src={{ url("vendor/datatables/dataTables.bootstrap4.min.js") }}></script>

<!-- Page level custom scripts -->

<script src={{ url("js/demo/datatables-demo.js") }}></script>
<!-- Argon JS -->
<script src="{{ asset('argon') }}/js/argon.js?v=1.0.0"></script>
<!-- Mix -->

<!-- Vue JS Scripts -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

but I deleted both for test but when i several click in a route option it log me out.

Activity icon

Replied to Double Click On Navbar Option = Logout

A made a test with a new controller. If in the return I call a view with a file with text only the system don't log me out but if in the view I @extends('layouts.dashboard') the dashboard well in that case Im logged out on double click.

Activity icon

Replied to Double Click On Navbar Option = Logout

Yep it was a misstype. Thank you.

Sep
24
2 months ago
Activity icon

Awarded Best Reply on Laravel Excel - Import CSV Data Relationed To Another Table

To anyone that in the future has the same problem, the correct way to doit isn't with models, instead you need to use collections: https://docs.laravel-excel.com/3.1/imports/collection.html

namespace App\Imports;

use App\User;
use Illuminate\Support\Collection;
use Maatwebsite\Excel\Concerns\ToCollection;

class UsersImport implements ToCollection
{
    public function collection(Collection $rows)
    {
        foreach ($rows as $row) 
        {
            User::create([
                'name' => $row[0],
            ]);
        }
    }
}
´´´
Activity icon

Replied to Double Click On Navbar Option = Logout

This is very weird, I read my route file web.php line by line trying to find an error or in the controller but nothing.

Activity icon

Replied to Double Click On Navbar Option = Logout

Im sorry the late, this is the doc, pretty easy to install, works with laravel 7x

https://argon-dashboard-laravel.creative-tim.com/docs/getting-started/quick-start.html

Sep
22
2 months ago
Activity icon

Replied to Double Click On Navbar Option = Logout

To discard the dashboard i installed a different one just for testing purpose but it happen the same, i double click on a option on nav bar and logout, but if I only click one time everything works good.

Unless that both dashboard have the same problem, im using a creative-tim dashboard.

Sep
21
2 months ago
Activity icon

Started a new Conversation Creative-tim: Argon - Graphics Dont Work With Mix

Hello, im installing Argon dashboard to test, but graphics stops working when I use id="app" in the main content. The Template works with vue because in the documentation they ask for install it 2. Type in your terminal: composer require laravel/ui and php artisan ui vue --auth

<div class="main-content" id="app">
        @include('layouts.navbars.navbar')
        @yield('content')
</div>

I wanna use id="app" so i can use Vue components with Laravel Mix but Graphics don't work

how it looks: https://imgur.com/DdoKYOI

Is there a way to fix this?

Sep
19
2 months ago
Activity icon

Started a new Conversation Double Click On Navbar Option = Logout

For some reason that I don't understand, when I double click on an option on the navbar that calls a route, laravel log me out from the system.

Isn't something that always happen but happens a lot. I can use href="{{ url('/home') }}" or simple href="/home" and happens the same, but if clicked only one time everything works good.

Also it doesn't matter the route I just copied /home for get one, but it happens to all.

 <li class="nav-item active">
    <a class="nav-link" href="{{ url('/home') }}">
    <i class="fas fa-fw fa-tachometer-alt"></i>
    <span>Dashboard</span></a>
</li>
Sep
16
2 months ago
Activity icon

Replied to Loading Spinner In Blade

It's there a way to call the function when the screen starts to loading?

Activity icon

Started a new Conversation What Does Require("bootstrap") ?

Actually i have a dashboard builded in bootstrap 4, but for some reason this line require("bootstrap"); its breaking the toggle navbar items. So if i comment the line the toggle start to works right again but idk if that function works for something important in laravel mix.

The file is located in resource/js/bootstrap.js and the file its called in the app.js

This is the code:

window._ = require("lodash");



try {
    window.Popper = require("popper.js").default;
    window.$ = window.jQuery = require("jquery");

    //This is the line that broke my toggle nav bar	
    require("bootstrap");
} catch (e) {}


window.axios = require("axios");

window.axios.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest";
Sep
15
2 months ago
Activity icon

Started a new Conversation Laravel Dashboard + Bootstrap4-vue

Hello, im looking for a Dashboard builded with Bootstrap4-vue. But all that i can find are builded in vue-cli, i want to use it in Blade like regular jquery dashboards.

Anyone know a Dashborad easy to integrate with laravel builded in Bootstra4-vue, any information is appreciated. Would like a free version to start.

Activity icon

Replied to Show Regular Validation / Request Errors.

Done I used the for inside the toast function declaration, im using a toast to show the message.

Thank you so much.

Activity icon

Replied to Show Regular Validation / Request Errors.

Almost, but returns me an object, how can i access that object message?

{planName: Array(1)}planName: Array(1)0: "The plan name has already been taken."length: 1__proto__: Array(0)__proto__: Object

I can't just put plan planName because changes in the error.

Activity icon

Replied to Show Regular Validation / Request Errors.

I think thats exactly the problem, because i just deleted the try catch in the php controller and I keep receiving the same message: The given data was invalid. So i think that its a regular message builded by axios, its not showing the message that backend sends. This is how i have the catch in the axios.

.then(response =>
    this.toast(
        "b-toaster-top-right",
        true,
        response.data,
        "success",
        "Done!"
   )
)
.catch(function (err) {
    console.log(err.response.data.message);
}

I think that the catch of axios its replacing the catch of backend, i want to show the message that backend send me.

Sep
14
2 months ago
Activity icon

Started a new Conversation Show Regular Validation / Request Errors.

Hello, im sending for post (axios) in a Vuejs component form some data, that im validating in the controller, but when returns the error only return the same word, not even the default errors "The given data was invalid."

What should i do to show the standard laravel errors related to each field.

in the try:

try {
        $data = request()->validate(
                [
                    'planName' => 'required|max:20|string|unique:plans,plan_name',
                    'planPrice' => 'required|numeric',
                    'maxAccounts' => 'required|integer',
                    'unlimited' => 'nullable|boolean',
                    'totalLists' => 'nullable|integer',
                    'contacts' => 'required|integer',
                    'sends' => 'required|integer'
                ]
     );

and the catch

} catch (\Exception $th) {

            return Response::json(
                array(
                    'code'      =>  301,
                    'message'   => $th->getMessage()
                ),
                301
            );
        }

Any help is appreciated.

Sep
13
2 months ago
Activity icon

Started a new Conversation Implement Drag And Drop Editor With Laravel

Hello,

I'm wondering if you have a good guide or tutorial to use https://github.com/voidlabs/mosaico with laravel or another drag and drop html editor that I could Insert the html to the database with laravel.

Any info its really appreciated.

Activity icon

Replied to Integrating A Mass Email System Into A Laravel Web-app With Existing User-management

Hello do you have any tutorial how to send the html from mosaico to database with Laravel?

Activity icon

Replied to It's Laracast YouTube Channel Dead?

So the answer is yes, is dead.

Activity icon

Started a new Conversation It's Laracast YouTube Channel Dead?

There is no new videos since a year.

Sep
10
2 months ago
Activity icon

Replied to Laravel 8 Error: Target Class [HomeController] Does Not Exist

Please edit the full answer to choose as best answer.

Activity icon

Replied to Laravel 8 Error: Target Class [HomeController] Does Not Exist

Fixed, i had to add the property in the boot method like this:

public function boot()
    {
        $this->configureRateLimiting();

        $this->routes(function () {
            Route::middleware('web')
                ->namespace($this->namespace)
                ->group(base_path('routes/web.php'));

            Route::prefix('api')
                ->middleware('api')
                ->group(base_path('routes/api.php'));
        });
    }
Activity icon

Replied to Laravel 8 Error: Target Class [HomeController] Does Not Exist

Thanks for your response, I really appreciated but saddly I have a system where i have more than 4000 routes, this isnt a solution viable for me, im trying to do what Michal recommend and is in domcumention but isn't working :-(

If you prefer Laravel 7.x style controller route prefixing, you may simply add the $namespace property into your application's RouteServiceProvider.
Activity icon

Replied to Laravel 8 Error: Target Class [HomeController] Does Not Exist

Check:

class RouteServiceProvider extends ServiceProvider
{
    /**
     * The path to the "home" route for your application.
     *
     * This is used by Laravel authentication to redirect users after login.
     *
     * @var string
     */
    public const HOME = '/home';

    /**
     * If specified, this namespace is automatically applied to your controller routes.
     *
     * In addition, it is set as the URL generator's root namespace.
     *
     * @var string
     */
    protected $namespace = 'App\Http\Controllers';

web.php

<?php

use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Auth::routes();

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

Keep lanunching same error.

Activity icon

Replied to Laravel 8 Error: Target Class [HomeController] Does Not Exist

It didnt work i had to add it in the web.php like nakov published

Activity icon

Replied to Laravel 8 Error: Target Class [HomeController] Does Not Exist

So if i want to upgrade to Laravel 8 from 7 i have to change all my routes???????????? O.o

Activity icon

Started a new Conversation Laravel 8 Error: Target Class [HomeController] Does Not Exist

Hi, i just installed laravel 8, so I tryed to use Laravel/ui with vue but the home controller is giving me this error:

Illuminate\Contracts\Container\BindingResolutionException
Target class [HomeController] does not exist.
http://127.0.0.1:8000/home

I uset used this commands to install Laravel ui

$ composer require laravel ui

$ php artisan ui vue --auth

$ npm install 

$ npm run dev

After that use the migration but it didn't worked. Any help is apreciated.

Sep
01
2 months ago
Activity icon

Replied to Laravel Excel - Import CSV Data Relationed To Another Table

To anyone that in the future has the same problem, the correct way to doit isn't with models, instead you need to use collections: https://docs.laravel-excel.com/3.1/imports/collection.html

namespace App\Imports;

use App\User;
use Illuminate\Support\Collection;
use Maatwebsite\Excel\Concerns\ToCollection;

class UsersImport implements ToCollection
{
    public function collection(Collection $rows)
    {
        foreach ($rows as $row) 
        {
            User::create([
                'name' => $row[0],
            ]);
        }
    }
}
´´´
Aug
31
2 months ago
Activity icon

Started a new Conversation Laravel Excel - Import CSV Data Relationed To Another Table

I need to import some rows from a CSV file to a table, but this rows are relationed to another table to create the realtion of two registers. Thos relations are created by a field ID autoincremental.

I have 3 tables involved

  1. tbl_party Relationed tbl_party_employee,
  2. tbl_employee Relationed to tbl_party_employee,
  3. tbl_party_employee The table where i created the relations between 2 tables.

This is the method where my rows are setted to register

 public function model(array $row)
    {
       
          return new Contact(
              [
                    'user_id' => $this->userId,
                    'subscriber_email'     => $row[0],
                    'subscriber_name'      => $row[1],
                    'subscriber_lastname'  => $row[2],
                    'subscriber_phone'     => $row[3],
                    'whatsapp_number'      => $row[4],
                    'birth_date'    => $this->formatDateExcel($row[5]),
                    'custom_field1' => $row[6],
                    'custom_field1' => $row[7],
                    'custom_field1' => $row[8],
                    'custom_field4' => $row[9],
              ]
          );   
    }

Any help to do this is appreciated.

Activity icon

Replied to Laravel Maatwensite Excel Import From Parent Child Relationship

Have the same problem, i have a file to import but the rows are relationed by autoincremental id in another table and i dont know how to create the double insert.

Jun
17
5 months ago
Activity icon

Replied to Adding A Condition To Auth Login

in what file can I do that?