santino

santino

am independent at home

Member Since 6 Months Ago

Chia

Experience Points
10,980
Total
Experience

4,020 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
100
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 3
10,980 XP
Apr
02
2 days ago
Activity icon

Awarded Best Reply on HELP With Gallery Controller !! Please

okay if some one want the answear I figure it out... thanks to @beyond for making a comment a trying to help me but The right way is this one...

on edit I made this

   $galleryItems = $service->serviceGallery->get(['image1' , 'image2', 'image3'])->first();

send the items I want to iterate, then in the blade

@for ($i = 1; $i <= 3; $i++)



                 <div class="col-12 col-md-4 card-body"><div class="card-body shadow">
                     <form method="POST"
                     action="{{ route( 'updateSG' , [$user->name , $service->slug]) }}"
                     @click="addImage('inputField{{$i}}')"
                     enctype="multipart/form-data">
                         @csrf

                         <div class="hvr-float hvr-icon-spin miPointer">
                             @if(Storage::disk('local')->exists($galleryItems['image'.$i]))
                             <div class="mithumb"><img src="{{ Storage::url($galleryItems['image'.$i])}}" class="img-fluid shadow-sm"></div>
                             @else
                             <div class="mithumb parent"><img src="{{ Storage::url('defaultImg.png')}}" class="img-fluid shadow-sm child"></div>
                             @endif
                             <h3 class=" info-color white-text text-center py-4 text-info">
                                 <strong><i class="fas fa-plus hvr-icon"></i> Change Image</strong>
                                 <input type="hidden" name="imageField" value="image{{$i}}">
                                 <input name="fileUpload" type="file" hidden id="inputField{{$i}}" onchange="form.submit()">
                             </h3>
                             <hr>
                             <small>Imagen de Portada #{{$i}}
                             </small>
                         </div>
                     </form>
                 </div>
             </div>


@endfor

made the foreach to iterate all items X3 because there is a table of 3 images gallery

then in the function method get the items

 public function updateSG(User $user , Service $serviceSlug , Request $request )
 {

     if ($serviceSlug->user_id == $user->id){

         $gallery = $serviceSlug->serviceGallery;

         $imageField = $gallery->get($request->imageField)->first()[$request->imageField];

         if ($imageField) {
             Storage::delete($imageField);
         }

         try {
             $gallery->update([
                 $request->imageField => $request->file('fileUpload')->store('/public/users/'.$user->name.'/servicesImages/'.$serviceSlug->id)
             ]);
         }
         catch (\Exception $e) {

             return back()->with( 'returnMessage', 'Your image was not uploaded, try again please' );
         }
         return back()->with('returnMessage', 'Your image was uploaded');

     }
     return redirect(route('error'))->with( 'returnMessage', 'Error trying to edit service' );
 }

THIS WAY NOTING REPETS and all is clear :) , thank to all.

Activity icon

Replied to HELP With Gallery Controller !! Please

okay if some one want the answear I figure it out... thanks to @beyond for making a comment a trying to help me but The right way is this one...

on edit I made this

   $galleryItems = $service->serviceGallery->get(['image1' , 'image2', 'image3'])->first();

send the items I want to iterate, then in the blade

@for ($i = 1; $i <= 3; $i++)



                 <div class="col-12 col-md-4 card-body"><div class="card-body shadow">
                     <form method="POST"
                     action="{{ route( 'updateSG' , [$user->name , $service->slug]) }}"
                     @click="addImage('inputField{{$i}}')"
                     enctype="multipart/form-data">
                         @csrf

                         <div class="hvr-float hvr-icon-spin miPointer">
                             @if(Storage::disk('local')->exists($galleryItems['image'.$i]))
                             <div class="mithumb"><img src="{{ Storage::url($galleryItems['image'.$i])}}" class="img-fluid shadow-sm"></div>
                             @else
                             <div class="mithumb parent"><img src="{{ Storage::url('defaultImg.png')}}" class="img-fluid shadow-sm child"></div>
                             @endif
                             <h3 class=" info-color white-text text-center py-4 text-info">
                                 <strong><i class="fas fa-plus hvr-icon"></i> Change Image</strong>
                                 <input type="hidden" name="imageField" value="image{{$i}}">
                                 <input name="fileUpload" type="file" hidden id="inputField{{$i}}" onchange="form.submit()">
                             </h3>
                             <hr>
                             <small>Imagen de Portada #{{$i}}
                             </small>
                         </div>
                     </form>
                 </div>
             </div>


@endfor

made the foreach to iterate all items X3 because there is a table of 3 images gallery

then in the function method get the items

 public function updateSG(User $user , Service $serviceSlug , Request $request )
 {

     if ($serviceSlug->user_id == $user->id){

         $gallery = $serviceSlug->serviceGallery;

         $imageField = $gallery->get($request->imageField)->first()[$request->imageField];

         if ($imageField) {
             Storage::delete($imageField);
         }

         try {
             $gallery->update([
                 $request->imageField => $request->file('fileUpload')->store('/public/users/'.$user->name.'/servicesImages/'.$serviceSlug->id)
             ]);
         }
         catch (\Exception $e) {

             return back()->with( 'returnMessage', 'Your image was not uploaded, try again please' );
         }
         return back()->with('returnMessage', 'Your image was uploaded');

     }
     return redirect(route('error'))->with( 'returnMessage', 'Error trying to edit service' );
 }

THIS WAY NOTING REPETS and all is clear :) , thank to all.

Activity icon

Replied to HELP With Gallery Controller !! Please

@beyond I make the for loop

@for ($i = 1; $i <= 3; $i++)
{{$service->serviceGallery->image.$i}}

got an error because the computer cant joint the 1 with the image... some idea here...??

this is the code on the blade.php

@for ($i = 1; $i <= 3; $i++)

                 <div class="col-12 col-md-4 card-body"><div class="card-body shadow">
                     <form method="POST"
                     action="{{ route( 'updateSG' , [$user->name , $service->slug]) }}"
                     @click="addImage('inputField{{$i}}')"
                     enctype="multipart/form-data">
                         @csrf

                         <div class="hvr-float hvr-icon-spin miPointer">
                             @if(Storage::disk('local')->exists($service->serviceGallery->image.$i))
                             <div class="mithumb"><img src="{{ Storage::url($service->serviceGallery->image.$i)}}" class="img-fluid shadow-sm"></div>
                             @else
                             <div class="mithumb parent"><img src="{{ Storage::url('defaultImg.png')}}" class="img-fluid shadow-sm child"></div>
                             @endif
                             <hr>
                             <h3 class=" info-color white-text text-center py-4 text-info">
                                 <strong><i class="fas fa-plus hvr-icon"></i> Change Image</strong>
                                 <input name="fileUpload" type="file" hidden id="inputField{{$i}}" onchange="form.submit()">
                             </h3>
                             <hr>
                             <small>Imagen de Portada #1
                             </small>
                         </div>
                     </form>
                 </div>
             </div>

@endfor
Apr
01
3 days ago
Activity icon

Started a new Conversation HELP With Gallery Controller !! Please

Hi ,communnity please help me... am trying to make a gallery of 3 images but don't know how to iterate 3 times this function

 public function updateSG(User $user , Service $serviceSlug , Request $request )
 {

         $gallery = $serviceSlug->serviceGallery;

         if ($gallery->image1) {
             Storage::delete($gallery->image1);
         }

         try {
             $gallery->update([
                 'image1' => $request->file('fileUpload')->store('/public/users/'.$user->name.'/servicesImages/'.$serviceSlug->id)
             ]);
         }

 }

this is running okay, but I DONT WANT TO COPY THIS FUNCTION 3 TIMES in order to save image 2 and image 3, and don't want to create a SWITCH STATEMENT inside the function... any clue please give me a hand

Mar
30
5 days ago
Activity icon

Replied to Slug On A Resource Method HELP!! How To Do It... :(

:) it works!! THANKS!!! dont understand how!!! but I am digging it :) very grate full

Mar
29
6 days ago
Activity icon

Started a new Conversation Slug On A Resource Method HELP!! How To Do It... :(

am having a hard issue... I create a resource... buy no idea how to set up a service slug check please

Route::resource('/user/{user}/services', 'ServiceController' , [
    'names' => [
        'index' => 'services',
        'create' => 'newService',
        'store' => 'storeService',
        'edit' => 'editService',
        'update' => 'updateService'
    ]
])

after doing this way I got to change the code to this new one... but I like the first one but don't have any idea how to do it right

check the code I am using...

Route::get('/user/{user:name}/services', '[email protected]')->name('services');
Route::get('/user/{user:name}/services/create', '[email protected]')->name('newService');
Route::post('/user/{user:name}/services', '[email protected]')->name('storeService');
Route::get('/user/{user:name}/services/{service:slug}/edit', '[email protected]')->name('editService');
Route::post('/user/{user:name}/services/{service:slug}', '[email protected]')->name('updateService');

first call the user name... then call the service by it slug, I want to do the same but in the resource method... som idea how to do it?... thanks

Mar
26
1 week ago
Activity icon

Replied to Create User With Profile Table

thanks @ellgreen , I try this with your code up and get a positive result!!


      $newUser = User::create([
            'name' => 'daniel',
            'email' => '[email protected]',
            'password' => Hash::make(123),
      ]);

$newUser->profile()->create();
$newUser->financialProfile()->create();
$newUser->contracts()->create();

// ALL 3 CREATE THE TABLES WITH THE ID OF THE USER THANKS A LOT,	


Regards Daniel

Activity icon

Started a new Conversation Create User With Profile Table

Hi, I am trying to create a user with a profile table related so far...

      $newUser = User::create([
            'name' => 'daniel',
            'email' => '[email protected]',
            'password' => Hash::make(123),
      ]);

      Profile::create([
            'user_id' => $newUser->id,
            'nombre' => 'Adminer',
            'apellido' => 'Jhonson',
      ]);

this is working but I thing there should be a better way to do it... can some one help me? am using for a role this one

$newUser->role()->attach(1);

I love this way

so I want to make something like this

$newUser->Profile()->attach($newUser->id); // this is my idea to create an attached table to that ID user

thanks in advance for your help

Mar
24
1 week ago
Activity icon

Replied to PUSHER Chat No Longer Available...

please some assistance here ... thanks

Mar
23
1 week ago
Activity icon

Started a new Conversation PUSHER Chat No Longer Available...

Hi, I am new with broadcasting, am reading a lot of it, but TODAY I see that on the web page of PUSHER no longer I can find the PRODUCT OF CHAT... That makes me think if I should use pusher for a chat I am going to create... (I DONT UNDERSTAND TO MUCH ABOUT THIS TOPIC PLEASE DONT KNOW IF I CAN USE THIS)

https://pusher.com/

Can someone give me and advise wish method should I use... I don't understand to much about it, but... I see there is PUSHER REDIS and I am reading laravel-websockets... PLEASE GET ME INTO THE RIGHT WAY THANKS IN ADVANCE

Mar
17
2 weeks ago
Activity icon

Replied to Seed A Seeder

Thanks for letting me know, this encourages me a lot to keep on!!! One day I hope to be level 50 like you.

Mar
16
2 weeks ago
Activity icon

Replied to Seed A Seeder

Thanks a lot, I am new and you seem to have a lot of experience!!, with all frameworks outside, do you think laravel is the best framework for developing? If yes why you prefer this one :) why is it better...

Activity icon

Replied to Seed A Seeder

Thanks @sinnbeck you know a lot of laravel!! this code gets my seeders running thanks a lot again.

Activity icon

Replied to Advise Creating A Profile User Route

Thanks a lot!! wowww that is so shorter and make it done!! Thanks!

Activity icon

Replied to Advise Creating A Profile User Route

@sinnbeck Thanks Sr.I really use your way, am it helps me a lot but I end up with this

public function index(Request $request)
{
   $profile= $request->user()->profile()->get()->first();
    return view('profile.index' , compact('profile'));
}

This way the controller calls the profile of the authenticated user and shows its profile attached as a relation ship

Do you think is the right way... let me know your thoughts about it, and thanks again for your help

Activity icon

Started a new Conversation Seed A Seeder

Hi, community of laravel, i am trying to seed a created seeder but I dont know how to do it some help please:

php artisan migrate:fresh --seed // this command seed all my database but just pull up this file = DatabaseSeeder

I got other file called Codex Seeder but I dont have a clue how to call migrate fresh --seed and call all my seed files to seed the database... thanks in advance

Mar
15
2 weeks ago
Activity icon

Started a new Conversation Advise Creating A Profile User Route

Hi community, I am new on laravel, I am creating an user with a profile made this route

Route::resource('/profile', 'ProfileController');

For some reazon I thing this is not the correct way to do this stuff, because I will need to call every single time the user ID to show the profile of the user on a PROFILE PAGE LIKE THIS WAY

/profile/5/show // this way I will see the profile number 5 BUT

the thing is I AM USER 5 , so I thing I need to enter onto

/user/5/profile // this should make the work...

or in the ProfileController I should USE USER then call

user->profile...

Please get me into the right spot, please, how is the right way to manage this because I need to create PRODUCTS CONTACT AND MONEY of the user Controllers thanks

Activity icon

Replied to Error With Camel Case Commands - Laracast Generators

Thanks, Sr. That solves the problem!!

Activity icon

Started a new Conversation Error With Camel Case Commands - Laracast Generators

When I create a model -a I got this error,

Created Migration: 2020_03_15_102555_create_delinns_table                                                                     
                                                                                                                              
   Error                                                                                                                      
                                                                                                                              
  Call to undefined function Laracasts\Generators\Commands\camel_case()                                                       
                                                                                                                              
  at C:\Users\user\apps\MLM\vendor\laracasts\generators\src\Commands\SeedMakeCommand.php:39                                   
    35|      * @return string                                                                                                 
    36|      */                                                                                                               
    37|     protected function getClassName()                                                                                 
    38|     {                                                                                                                 
  > 39|         return ucwords(camel_case($this->getNameInput())) . 'TableSeeder';                                            
    40|     }                                                                                                                 
    41|                                                                                                                       
    42|     /**                                                                                                               
    43|      * Get the stub file for the generator.                                                                           
                                                                                                                              
  1   C:\Users\user\apps\MLM\vendor\laracasts\generators\src\Commands\SeedMakeCommand.php:62                                  
      Laracasts\Generators\Commands\SeedMakeCommand::getClassName()                                                           
                                                                                                                              
  2   C:\Users\user\apps\MLM\vendor\laravel\framework\src\Illuminate\Console\GeneratorCommand.php:74                          
      Laracasts\Generators\Commands\SeedMakeCommand::buildClass("App\DelinnSeeder")   

Does some one know how to fix it, I just update from laravel 6 to 7 and end up with that error run this on mi composer.JSON

"laracasts/generators": "dev-master",

That did not solve the error, thanks in advance

Mar
11
3 weeks ago
Activity icon

Replied to Help With Controller Call

O, my GOD!!!!! You are a genius, thanks you!

Activity icon

Replied to Help With Controller Call

@ftiersch @sergiu17 my route is this way

Route::resource('/getservice', 'GetserviceController');

Is a route resource... how can it be managed

Activity icon

Started a new Conversation Help With Controller Call

Hi, I am trying to get on the SHOW method the information of a service

class GetserviceController extends Controller
{
	public function show(Service $service)
	{
		dd($service);
	}

But get no information, I have some clue... My service is another MODEL and has its own controller all is apart... http://localhost:3000/getservice/2

I need to call the number 2 - that means the service ID 2 ... but I don't Know how ii can extend the GetserviceController to understand that he needs to get the number 2 on the show method and find that ID on the service MODEL

Hope I make my self understood, thanks in advance for your help

Feb
20
1 month ago
Activity icon

Replied to Array Of ROUTE:GETs... Help Making The Array

Thanks MR @sinnbeck, helping me with all your feedback :)

Activity icon

Replied to Array Of ROUTE:GETs... Help Making The Array

Is there a way to make something like this:

Route::get( array(
 home', '[email protected]')->name('home');
advantages', '[email protected]')->name('advantages');
features', '[email protected]')->name('features');
statics', '[email protected]')->name('statics');
about', '[email protected]')->name('about');
preorder', '[email protected]')->name('preorder');

));

this way i know all this calls are get method... Just asking am very new to Laravel am still learning. thanks a lot

Activity icon

Replied to Array Of ROUTE:GETs... Help Making The Array

Thank you, how can use the parameter ->NAME( )

Activity icon

Started a new Conversation Array Of ROUTE:GETs... Help Making The Array

Hi, laravel community please I want to create an array of the route get... in this moment I have this

Route::get('/home', '[email protected]')->name('home');
Route::get('/advantages', '[email protected]')->name('advantages');
Route::get('/features', '[email protected]')->name('features');
Route::get('/statics', '[email protected]')->name('statics');
Route::get('/about', '[email protected]')->name('about');
Route::get('/preorder', '[email protected]')->name('preorder');

But I read on a post that you can have some kind of array like :


Route::get('/', array(
    'home' => '[email protected]', // NEED NAME PARAMETER HERE
    'advantages' => '[email protected]'  // NEED NAME PARAMETER HERE

SOMEONE CAN HELP ME, THANKS A LOT

Dec
10
3 months ago
Activity icon

Commented on Consider Named Routes

Hi, I was wondering how I can make a name ROUTE if I am using a resource like this

Route::resource('/profile', 'ProfileController'); Thanks a lot

Oct
07
5 months ago
Activity icon

Replied to Please Some Help Trying To Access ROLES

Thank you!! @nakov I go to the database and there is a NULL field that was the error!! thanks

Activity icon

Started a new Conversation Please Some Help Trying To Access ROLES

Please community help with this code, On the controller am sending this data

  public function index()
  {
    $users = User::all();
    return view('/user.index', compact('users'));
  }

On the view I cant call the roles with this code

{{ $user->roles->first()->id }}

// got this error => Trying to get property of non-object I got to suspend it

        @foreach($users as $user)
        <tr>
            <td>{{$user->id}}</td>
            <td>{{$user->name}}</td>
            <td>{{$user->email}}</td>
            {{-- <td>{{$user->roles->first()->name}}</td> --}}
            {{ $user->roles->first()->id }}
            <td><a href="/user/{{$user->id}}"><i class="fas fa-eye"></i> Ingresar</a></td>
            @endforeach

BUT when I call that same last code on the SHOW view it runs

$user->roles->first()->id

how i can call it? the ROLES...

am calling them this way on the class User extends Authenticatable

    public function roles()
    {
        return $this->belongsToMany(Role::class); // nombre del modelo
    }

thanks to the laravel community

Oct
06
5 months ago
Activity icon

Replied to Help Me Cant Extends The User

you are a GENIUS Mr @snapey THANKS a lot!!! I got to use the name USER on my folder that way it can change it !! that was my error thanks

Activity icon

Replied to Help Me Cant Extends The User

Not that way got a NULL cant GET the id with this way. But thanks

Activity icon

Replied to Help Me Cant Extends The User

Thanks, my code is like this on the routes area

Route::resource('admin','AdminController');

Then on the AdminController

use App\User;
use Illuminate\Http\Request;
class AdminController extends Controller
{
  public function show(User $id)
  {
    return $id;
  }
}

but the return is []

null the controlled dont get any data

I got to write this code

 public function show($id)
  {
    $usuario = User::find($id); 
    return view('/admin.show', compact('usuario'));
  }

But I saw on the videos of laravel that I must use User $id and that should go to the user class and get the ID but in my case, I am missing something @snapey please some advise here :)

Oct
05
5 months ago
Activity icon

Started a new Conversation Help Me Cant Extends The User

I am trying to use this on the controller

use App\User;
class AdminController extends Controller
{
  public function show(User $id)
  {
    return $id;
  }
}

On my URL I got

/admin/7

but the return is []

why I cant get the user ID if i am calling it with the class insted i have to write the next code to get the ID

  public function show($id)
  {
    $usuario = User::find($id); 
    return view('/admin.show', compact('usuario'));
  }

Thanks a lot for your time, please put me on the right way

Oct
03
6 months ago
Activity icon

Replied to Help Me Foreach My Database Please

@cronix I mark Snapey solution because he was the only one that gave me feedback Thanks to Him I was able to get this working, On my comment, my intention was to give the shorter and cleaner code based on Snapey code, not my solution Snapey one, if you read the comment I gave him all the credits and if you read all the post you will find that he is the only one that helps me solve it. BUT BUT @cronix you are right, thank you for let me see that Instead of mark my post as the solution, I will mark @snapey post even if it got more code the right thing to do is to credit him on first(). Regards Santino

Activity icon

Replied to Help Me Foreach My Database Please

YES Snapey!!!!!! this is working!!!! This is the right code to get the Value Keys of all the row

    @foreach($datosCliente as $dataClient)
                @foreach(collect($dataClient)->keys() as $key)
                        {{ $dataClient->$key }}<br>
                @endforeach 
    @endforeach 
            

Thanks you SANAPEY !! Regards Santino.

Oct
02
6 months ago
Activity icon

Replied to Help Me Foreach My Database Please

i have this

$datosCliente = ClientForm::where('id', $cliente->id)->get();
return view('clientes.show', compact('cliente'))->with('datosCliente', $datosCliente);

in the other script i got this

            @foreach($datosCliente as $dataClient)
            
            {{$dataClient}}

            @foreach($dataClient->keys() as $key)

            <td>{{ $dataClient->$key }}</td>

            @endforeach 


            @endforeach

Its working until the code gets to this foreach

            @foreach($dataClient->keys() as $key)

if I delete the foreach the machine prints this, all the field values of the row

{"id":1,"nombres":"hector","apellidos":"varela","nacimiento":"1950-01-01","lugarNacimiento":"bogota","estadoCivil":"SOLTERO","nombrePareja":null,"identificacion":"1072660142","pais":"AX","direccionR

Activity icon

Replied to Help Me Foreach My Database Please

yes snapey this is the way!! but i get this error Invalid argument supplied for foreach() (View: ON THIS @foreach($data->keys as $key)

The machine dont know what is KEYS - It dont spit out the values of each field...

Activity icon

Replied to Help Me Foreach My Database Please

I have not found the solution to this matter someone...

I want to make a forloop or foreach or a for to get the data of each field of a table row am doing this way and I know is wrong because I don't know how to do it

@foreach($cliente->clientform as $ dataClient)
            <th>{{ $dataClient->nombres }}</th>
            <th>{{ $dataClient->apellidos }}</th>
            <th>{{ $dataClient->nacimiento }}</th>
            <th>{{ $dataClient->lugarNacimiento }}</th>
            <th>{{ $dataClient->estadoCivil }}</th>
            <th>{{ $dataClient->nombrePareja }}</th>
            <th>{{ $dataClient->identificacion }}</th>
            <th>{{ $dataClient->pais }}</th>
            <th>{{ $dataClient->direccionResidencia }}</th>

//40 more fileds down am calling each one name by name - this is a time consuming dude

            @endforeach

WHAT CODE I SHOULD USE? to get a loop that go throw all the fields of the row and print that... Please give me a hand on here

Thanks, Santino codex

Activity icon

Started a new Conversation Send Emails With Laravel And Google Gmail Smtp SSL

After spending a day trying to make google Gmail send and email finally I achieved it and I want to share the way and codes I use to make it happen... maybe you are trying to make the same

On the .env file

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=this code is generated read more down
MAIL_ENCRYPTION=ssl
[email protected]
MAIL_FROM_NAME=yourName
MAIL_LOG_CHANNEL=NULL

On the mail.php

return [
    'driver' => env('MAIL_DRIVER'),
    'host' => env('MAIL_HOST'),
    'port' => env('MAIL_PORT'),
    'from' => [
        'address' => env('MAIL_FROM_ADDRESS'),
        'name' => env('MAIL_FROM_NAME'),
    ],
    'encryption' => env('MAIL_ENCRYPTION'),
    'username' => env('MAIL_USERNAME'),
    'password' => env('MAIL_PASSWORD'),
    'sendmail' => '/usr/sbin/sendmail -bs',
    'markdown' => [
        'theme' => 'default',
        'paths' => [
            resource_path('views/vendor/mail'),
        ],
    ],
    'log_channel' => env('MAIL_LOG_CHANNEL'),
];

I add this code on the file that calls the /Mail::To() ON THE TOP I don't know if that is useful but I just added and all is working so I will not remove it... Just in case it's needed

use Illuminate\Support\Facades\Mail;

Okay that's it for the code now you must

  1. Enter your Google account
  2. go to account -> security
  3. then fill up the two-ways authentication to google
  4. After doing all that you must GENERATE AN APP CODE
  • on the same security tap, you will find something called APP Password enter and generate one.
  1. with that code COPY and PASTE IT on the .env file
MAIL_PASSWORD= HERE!!

that code allows you to send emails with google GMAIL

hope someone reaches this post and be useful for the Laravel community and Laracast too

Santino codex / If this helps you leave me a comment :)