kreierson

Experience

24,800

1 Best Reply Awards

  • Member Since 2 Years Ago
  • 297 Lessons Completed
  • 6 Favorites

14th November, 2017

kreierson left a reply on Checking Array Length • 1 week ago

@tisuchi Thanks for the reply! Turns out I was an idiot and forgot I converted the array to an object :p

kreierson left a reply on Checking Array Length • 1 week ago

Figured it out. I forgot I was using reduce on the array to group the trips by date, which turned the trips array into an object.

self.trips = response.data.trips.reduce(function(r, a) {
                        r[a.start_date] = r[a.start_date] || [];
                        r[a.start_date].push(a);
                        return r;
                    }, Object.create(null));

I did this in case anyone else comes across this.

self.hasTrips = response.data.trips.toString();

Then did my v-show on the hasTrips property.

kreierson left a reply on Checking Array Length • 1 week ago

PS, I am not able to pass the trips in as a prop.

kreierson started a new conversation Checking Array Length • 1 week ago

I have a vue component with and initial data property set to an empty array.

data: function() {
            return {
                trips: [],
        }
}

Then in the mounted hook, I do a request and populate that array.

In my vue template, I want to show a table of the results if the trips array has any trips in it, and I want to show a div saying there are no trip available if the array is empty.

I am currently doing this

<table class="table table-borderless" v-show="trips.length">
    Table data
</table>

<p v-show="!trips.length">No trips available</p>

The

tag always shows up, event though I can see there are trips available in the Vue devtools. I understand it's probably initializing as an empty array, but shouldn't Vue pick up on the change and display the results when the array is eventually populated? How do I solve this?

Thanks!

1st November, 2017

kreierson left a reply on Use Relationship To Display User Name In Comment • 3 weeks ago

You need

Route::post('/blog/slug/comments/id', '[email protected]');

In your routes file.

kreierson left a reply on Use Relationship To Display User Name In Comment • 3 weeks ago

When you get your comments you have to pull in the user relationship.

    $comments = Comment::with('user')->where('post_id', $postId)->get();
        return response()->json(['comments' => $comments]);

Then you can do this

export default {
        data: function() {
            return {
               comments: [],
            }
        },
        mounted: function() {
            var self = this;    
            axios.get('/post/'+slug+'/comments/').then(function(response) {
                self.comments = response.data.comments;
            });
        }
        
    }

Then you can do this

<div v-for="comment in comments">
        <h4>{{comment.user.name}}</h4>
        <p>{{comment.text}}</p>
    </div>

kreierson left a reply on Use Relationship To Display User Name In Comment • 3 weeks ago

Maybe something like this...

    export default {
        data: function() {
            return {
               comments: [],
            }
        },
        mounted: function() {
            var self = this;    
            axios.get('/post/'+slug+'/comments/').then(function(response) {
                self.comments = response.data.comments;
            });
        }
        
    }

kreierson left a reply on Best Way Of Sending Flash Message From Laravel To Vue • 3 weeks ago

Cool, another thing I have done is check for errors on a master layout page. Create a footer section and extend the footer on each page. Then you don't have to pass it in as a prop on every component, you just handle it with a quick script.

    // Master layout
    <div class="errors" style="display:none;">
        <ul>
            @foreach($errors as $error)
                <li>{{$error}}</li>
            @endforeach
        </ul>
    </div>
    @yield('content')

    @yield('footer')

//Page where your component lives
@section('content')
    <your-component></your-component>
@endsection

@section('footer')
    @if(session('errors'))
          <script>
              // Code to make errors visible
          </script>
    @endif
@endsection

kreierson left a reply on PUT/PATCH Request Not Getting The Request Payload • 3 weeks ago

Is there another route above this route that maybe has the same path and that route is getting hit first? Just a thought, I run into this all the time.

Route::patch('/items/{item}', '[email protected]'); //This will get hit first

Route::resource('/items', 'ItemcontrollerApi'); //This will also get hit before the put request

// move this line above the two before this
Route::put('/items/{item}', '[email protected]')->name('items.update');

kreierson left a reply on Use Relationship To Display User Name In Comment • 3 weeks ago

I don't think you would want to pull the comments for a post from an index method on a CommentController.php. The index method assumes you are pulling all resources, meaning all comments with no regard to which post they are for. I would do a PostCommentController.php and hit the index method, that way it's a little more expressive on what you are grabbing. In this case all comments for a post. You would still need to pass the id of the post to the index method.

class PostCommentsController
{
    public function index($postId)
    {
        $comments = Comment::where('post_id', $postId)->get();
        return response()->json(['comments' => $comments]);
    }
}

kreierson left a reply on Best Way Of Sending Flash Message From Laravel To Vue • 3 weeks ago

Ah, so if you're flashing a message to the session similar to this:

$request->session()->flash('error', 'Email already exists!');

Maybe you can do this?

<component :prop="{{session()->get('error')}}"></component>

kreierson left a reply on Why Redirecting Me To Other Site • 3 weeks ago

Maybe check your session lifetime in config.session.

Also are you working on Windows? I've had this happen to me before, and ended up installing homestead and running my app on that instead of using php artisan serve and I haven't had that issue since.

kreierson left a reply on Catch Event On Table Row Component ? • 3 weeks ago

I'm assuming there is a method somewhere in the child component that updates the detail. Inside that method or where ever that detail gets update, you can emit an event.

updateDetail: function() {
    this.$emit('detail-updated', payload);
}

Then on your parent component

    // Listen for the detail-updated event inside the child, then call updateDetail
    // on the parent
    <child-component @detail-updated="updateDetail"></child-component>
    updateDetail: function(payload) {
        //do what needs to be done.
    }

kreierson left a reply on Best Way Of Sending Flash Message From Laravel To Vue • 3 weeks ago

As @vapenation said it should come from your backend. I usually create a form request to handle the validation, or you can put that in your controller. Then Laravel will respond with a 422 allowing you to catch that error response and display the error message. Here is a video that goes through that exact process. https://laracasts.com/series/learn-vue-2-step-by-step/episodes/19

31st October, 2017

kreierson left a reply on Vue Google Maps And Foreach Statment On Markers • 3 weeks ago

Total shot in the dark but might give you an idea. I'm not that great at javascript.

var newMarkers = this.markers.map(function (marker) { //Map over the markers
                    for (i = 0; i < this.markers.length; i++) { // loop over the markers
                        if (this.markers.indexOf(marker) != this.markers[i]) { // Make sure we don't compare the marker to itself
                            if(Object.is(marker.position, this.markers[i].position)) { //compare the position on the marker
                                return { // if the position on the markers match, build a new marker adding 2
                                    position: {
                                        lat: marker.position.lat+2,
                                        lng: marker.position.lat+2,
                                    },
                                    infoText: marker.infoText
                                }
                            }
                        }
                        return marker;
                    }
                });

kreierson left a reply on Vue Google Maps And Foreach Statment On Markers • 3 weeks ago

If you're just dumping these values out to a table

<table>
    <tr>
        <td>Lat</td>
        <td>Lng</td>
        <td>Text</td>
    </tr>
    <tr v-for="marker in markers">
        <td>{{marker.position.lat}}</td>
        <td>{{marker.position.lng}}</td>
        <td>{{marker.infoText}}</td>
    </tr>
</table>

Or if you need to loop through them in a method or mounted function just use javascript

this.markers.forEach(function(marker) {
      console.log(marker);
});

kreierson left a reply on PUT/PATCH Request Not Getting The Request Payload • 3 weeks ago

try putting a / before items in your axios request?

export const updateItem = ({ commit, dispatch }, payload) => {
    return axios.put('/items/' + payload.id, payload).then((response) => {
            return Promise.resolve(response)
        })
}

kreierson left a reply on Use Relationship To Display User Name In Comment • 3 weeks ago

Maybe something along these lines if you want to grab the post along with all the comments. This is also assuming you have a relationship called comments on your post model and a relationship called user on your comments model.

From your posts controller

public function show($id) {

    $post = Post::with('comments.user')->where('id', $id)->firstOrFail();
    return response()->json(['post' => $post]);
}

    export default {
        data: function() {
            return {
                post: {},
            }
        },
        mounted: function() {
            var self = this;    
            axios.get('/post/'+post_id).then(function(response) {
                self.post = response.data.post;
            });
        }
        
    }

Then where ever you are dumping out the comments on your page

    <div v-for="comment in post.comments">
        <h4>{{comment.user.name}}</h4>
        <p>{{comment.text}}</p>
    </div>

kreierson left a reply on Why Redirecting Me To Other Site • 3 weeks ago

Maybe check the APP_URL in your .env file?

kreierson left a reply on V-model With Transnational Data • 3 weeks ago

I guess I can v-model on the id of the package in the reservation and package table. Then do array.filter() to get the selectedPackage from the available packages to show pricing info on the page.

30th October, 2017

kreierson started a new conversation V-model With Transnational Data • 3 weeks ago

I have a system where a customer can make a reservation for a trip. On that reservation they can choose a package. Below is an example of my tables for these two objects.

Reservations Table | id | customer_id | price | no_of_people | package_id | package_name | package_price | | --- | --- | --- | --- | --- | --- | --- | | 1 | 550 | 15000 | 2 | 1 | Lodging | 9000 | | 2 | 499 | 15000 | 2 | 2 | Ultimate | 13000 |

Package Table | id | name | price | | --- | --- | --- | | 1 | Lodging | 9000 | | 2 | Ultimate | 13000 |

Creating a reservation and using v-model on the select box is straight forward

<select class="form-control form-control-sm" v-model="reservation.package">
    <option v-for="package in available_packages" :value="package">
          {{package.name}}
    </option>
</select>
                                        

My issue comes into play when I am building the edit form. I want them to be able to update the package and if i use v-model just like above, I run into an issue if the admin decides to update the price or name of the package. If the name or price is updated, the name and most importantly the price gets updated. When the reservation was made, the customer expects to pay that price, but if the company updates the package, now the relationship is looking at the updated price.

Since the reservation is a transaction, I need to capture that price on the reservation at the time of booking, so how would I use v-model on a select box when I need to show pricing information from the reservation table for the selected package, and not the price from the package table.

I hope that makes sense. Thanks!

21st October, 2017

kreierson started a new conversation Dealing With Relationships After They Change. • 1 month ago

Say I have an application that allows guides to manage their clients. It handles reservations and different packages they offer.

Lets say the guide creates a package in the system and the price is $50, which is added to the reservation price because the client wanted the package that provides lunch for the day. So the reservation has a relationship to the package table to pull in this price. The day comes and the client pays and all is good. Then a month down the road the guide decides to change the price on the package from $50 to $75. This is probably fine going forward, but now if there is any sort of reporting or if the guide decides to look at this trip from a month a go in the web interface, the way the relationships are set up it's going to show the client owes $25.

What's the best way to handle this type of scenario?

14th October, 2017

kreierson left a reply on Response.data Adding Attributes And Formatting Data • 1 month ago

Figured it out. Dhtmlx scheduler I am using was formatting when calling their parse method.

kreierson started a new conversation Response.data Adding Attributes And Formatting Data • 1 month ago

I am doing an axios get request:

axios.get('/outfitter/calendar/api').then(function(response) {
    self.events = response.data;
});
                        

When I look at my vue events object it seems to have additional attributes and is formatting my dates incorrectly. Below is a look at an object in the array

{
_timed:true
end_date:"2017-10-02T22:00:00.000Z"
id:1508019226512
section_id:25
start_date:"2017-10-02T13:00:00.000Z"
text:"One Day Fishing Trip"
}

Below is what I am passing from my endpoint and is what i see when I dump the results to the screen.

section_id: 25,
text: "One Day Fishing Trip",
start_date: "2017-10-02 07:00:00",
end_date: "2017-10-02 16:00:00"

Why is the _timed, id getting appended to the object and why are the dates getting formatted?

29th September, 2017

kreierson left a reply on Vue Refs • 1 month ago

Basically what I am trying to do is port this clockpicker https://weareoutman.github.io/clockpicker/ over to a vue component.

<template>
        <input
            ref="picker"
            type="text"
            class="form-control clockpicker"
            :value="time">
</template>
<script>
    export default {
        props: ['time'],
        mounted: function() {
           this.$refs.picker.clockpicker({
                twelvehour:true,
                donetext: 'Done'
            });
        }
    }
</script>

If I console.log(this.$refs.picker) I get a string representation of the input ""

So @ejdelmonico , this seems to show that the $refs are available at this point.

if I put an id on the input and console.log($('#input')) I actually get the object back so I can initialize the clockpicker.

I am wanting to initialize the clockpicker without the use of Jquery so I can re-use it in my project.

kreierson started a new conversation Vue Refs • 1 month ago

I'm trying to initialize a clockpicker without using jquery. I was thinking I could do this.

// component template tag

<input
            ref="picker"
            type="text"
            class="form-control clockpicker"
            :value="time">
// component script tag

mounted: function() {
           this.$refs.picker.clockpicker({
                twelvehour:true,
                donetext: 'Done'
            });
        }

But I am getting "TypeError: this.$refs.picker.clockpicker is not a function"

It seems the this.$refs isn't returning the entire dom object like jquery does, just a string of the input.

Thanks,

27th September, 2017

kreierson left a reply on Using API Resource In Laravel 5.5 And Pass Data To Blade View • 1 month ago

Ahhh.... I'm an idiot.... Thanks man!

26th September, 2017

kreierson started a new conversation Using API Resource In Laravel 5.5 And Pass Data To Blade View • 1 month ago

I want to use the new API Resource feature to access data from my models because of the flexibility in structuring the data.

Currently, I query my model using eloquent and pass that data to a blade view which has Vue components. I then pass this data into the components as props.

// Controller
public function show($id) {
    $data = [ 
        'user' => User::where('id', $id)->firstOrFail()
    ]
    
    return view('app.user.profile', $data);
}


// Blade view

@extends('layouts.app')

@section('content')
    <user-profile :user="{{ $user }}"></user-profile>
@endsection

This all works great. But when I wrap the user query in a UserResource like below:

// Controller
public function show($id) {
    $data = [ 
        'user' => new UserResource(User::where('id', $id)->firstOrFail())
    ]
    
    return view('app.user.profile', $data);
}

// API Resource class

public function toArray($request)
    {
        return [
            'first_name' => ucfirst($this->first_name),
        'last_name' => ucfirst('$this->last_name),
            'email' => $this->email,
        ];
    }

Then I get an error saying "htmlspecialchars() expects parameter 1 to be string, object given"

It would be great if I could use the new API Resource and pass it to blade views rather than making an ajax request from my Vue components. If it's not possible I suppose an ajax call isn't the end of the world.

Thanks in advance.

21st April, 2017

kreierson left a reply on Custom Polymorphic Relations • 7 months ago

Try this on your info model:

protected $morphClass = 'info';

9th April, 2017

kreierson started a new conversation Randomly Lose Auth Session And Get Redirected To Login Page • 7 months ago

I seem to be losing my auth session when making api calls from my application. I followed this video https://laracasts.com/series/whats-new-in-laravel-5-3/episodes/13 to set up passport so I could use axios to make calls to my api.php in the routes folder.

Everything works perfectly when I'm using the application from the local machine.

When I browse to the application from another computer and hit a route that makes an api call, I get a status code of 302 Found and get redirected back to the login page. But the weird thing is is sometimes the request will go through just fine but eventually maybe a request or two later I will lose my session and be redirected again.

Api Routes file

Route::group(['prefix' => '/v1', 'middleware' => 'auth:api'], function () {
     /**
      * Employee Routes
      */
     Route::get('/employees', 'api\v1\[email protected]');
     Route::post('/employees', 'api\v1\[email protected]');
     Route::get('/employees/{id}', 'api\v1\[email protected]');
});

Web Routes file

Route::group(['middleware' => 'web'], function() {
     //Auth routes
     Route::group(['middleware' => 'auth'], function() {
          //Dashboard Routes
          Route::get('/dashboard', '[email protected]');

          //Calendar Routes
          Route::get('/calendar', '[email protected]');

          //Employee Routes
          Route::get('/employees', '[email protected]');
          Route::get('/employees/{id}', '[email protected]');
     });
Auth::routes();
});

Web Middleware Groups

protected $middlewareGroups = [
        'web' => [
            \App\Http\Middleware\EncryptCookies::class,
            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
            \Illuminate\Session\Middleware\StartSession::class,
            // \Illuminate\Session\Middleware\AuthenticateSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
            \App\Http\Middleware\VerifyCsrfToken::class,
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
            \Laravel\Passport\Http\Middleware\CreateFreshApiToken::class,
        ],

I was under the impression that the CreateFreshApiToken would allow you to make axios requests to your api from your application, that is what the video states.

I also have this in my app.blade.php file

window.axios.defaults.headers.common = {
       'X-CSRF-TOKEN': Laravel.csrfToken,
       'X-Requested-With': 'XMLHttpRequest'
     };
axios.defaults.withCredentials = true;

Any guidance would be greatly appreciated.

1st March, 2017

kreierson left a reply on Authenticating With External API Using JWT? • 8 months ago

@rcastellanosm I'm looking to do this exact same thing. What did you end up going with?

Thanks

25th September, 2016

kreierson left a reply on Custom Accessor Or Attribute Casting Not Getting Called When Using Column Alias In Eloquent Query • 1 year ago

@Snapey, I think transformers is the way to go. It's working like a charm. Thanks again!

24th September, 2016

kreierson left a reply on Custom Accessor Or Attribute Casting Not Getting Called When Using Column Alias In Eloquent Query • 1 year ago

Thank you both for your time and responses! I think I'm going to do a little more research on transformers. Never used them before so now looks like a good time to learn. I think that's the best and clranest way to go about this. Thanks for the link @Snapey!

23rd September, 2016

kreierson left a reply on Custom Accessor Or Attribute Casting Not Getting Called When Using Column Alias In Eloquent Query • 1 year ago

I guess I can store all_day as a string and store "true" and "false". That solves the issue I am having. But still curious as to why the accessor isn't being called when using a column alias.

kreierson left a reply on Custom Accessor Or Attribute Casting Not Getting Called When Using Column Alias In Eloquent Query • 1 year ago

Thanks for the reply @Snapey ,

That also doesn't work, the problem is the accessor isn't even getting called. For example when I do this:

    return Trip::where('company_id', Auth::guard('api')->user()->company_id)->get(['id', 'title', 'start', 'end', 'all_day', 'url']);

I get this as a response:

[{"id":1,"title":"Bob Smith","start":"2016\/09\/12 12:00 am","end":"2016\/09\/15 12:00 am","all_day":"true","url":"\/trips\/1"}]

This is great as the accessor is getting called and converting the all_day column to "true" like I want, but I need the column name to be allDay So when I alias the column like this:

    return Trip::where('outfitter_id', Auth::guard('api')->user()->outfitter_id)->get(['id', 'title', 'start', 'end', 'all_day as allDay', 'url']);

I get this as a response:

[{"id":1,"title":"Bob Smith","start":"2016\/09\/12 12:00 am","end":"2016\/09\/15 12:00 am","allDay":1,"url":"\/trips\/1"}]

Now, the column name is what I want but it simply pulled the database column value not calling the accessor at all.

kreierson started a new conversation Custom Accessor Or Attribute Casting Not Getting Called When Using Column Alias In Eloquent Query • 1 year ago

Hello there,

I have the following eloquent query.

    Trip::where('id', $request->id)->get(['id', 'title', 'start', 'end', 'all_day as allDay', 'url']);

I am trying to cast the all_day database attribute to boolean when returning the json back to the client. Since I am using FullCalendar, I need to have the returned column as "allDay" and not "all_day", which is why I am using a column alias. If I don't column alias the all_day column both my blocks of code below work fine. But as soon as I add the column alias, it returns an integer and not boolean.

//Attribute Casting
    protected $casts = [
                'all_day' => 'boolean'
                ];
//Accessor
    public function getAllDayAttribute($value) {
        return ($value == 0 ? 'false':'true');
    }

Any help would be greatly appreciated.

20th September, 2016

kreierson left a reply on .gitignore What Should Be Ignored? • 1 year ago

I don't ignore my Vendor folder. Since I use Laravel Forge, it's nice to be able to push to a git repo then have Forge pull in the changes for me to update my website.

7th May, 2016

kreierson left a reply on Login On Mobile • 1 year ago

Just logged in and am making this comment on my Note 4 using Chrome. Looks like it's working now.

5th May, 2016

kreierson left a reply on Laravel On IIS • 1 year ago

WOW....Thank you guys for your time and input. After spending an entire day on this I got pissed and uninstalled URL Rewrite and then reinstalled. Now it works perfect. You have to love IIS. Thanks again for your help.

4th May, 2016

kreierson left a reply on Laravel On IIS • 1 year ago

I can post to http://localhost/index.php/login just fine. But having index.php in all my url's is ugly and I don't want to do that.

kreierson started a new conversation Laravel On IIS • 1 year ago

Ok so I have been trying to get this to work for days so I have finally decided to ask.

I need to get Laravel to work with IIS. My company uses windows authentication and we are building a helpdesk system. They would like it to automatically authenticate the user based on the user logged into the computer. I have everything working just fine until I try to set up a route. So if I go to http://localhost I can get there just fine. But if I set up this route

Route::post('login', 'PagesControllter@postLogin');

Then try to submit to that route I always get a 404 error back. Below is my web.config file.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.webServer>
        <handlers>
         
        </handlers>
        <rewrite>
            <rules>
                <rule name="Imported Rule 1" stopProcessing="true">
                    <match url="^(.*)/$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Redirect" url="/{R:1}" redirectType="Permanent" />
                </rule>
                <rule name="Imported Rule 2" stopProcessing="true">
                    <match url="^" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

I am pointing my web application in IIS to the public directory in Laravel. Any help would be greatly appreciated.

Kyle

26th April, 2016

kreierson started a new conversation Login On Mobile • 1 year ago

Whenever I try to login on my Samsung Note 4 using Chrome the site seems to just sit there and not log me in. Been trying for a week or two now. Not a huge deal as I usually watch videos on my computer, but I follow the forum on twitter and am unable to respond from my phone as I can't login to Laracasts.

25th April, 2016

kreierson left a reply on File Won't Upload • 1 year ago

Maybe it has something to do with the file size?

PHP has several configuration options to limit resources consumed by scripts. By default, PHP is set to allow uploads of files with a size of 2MB or less. Try increasing the following values in php.ini, for example: memory_limit = 32M upload_max_filesize = 24M post_max_size = 32M.

kreierson left a reply on Laravel Password Confirmation Problems • 1 year ago

Shot in the dark, sometimes I forget to change the request in my controller method.

I will sometimes do this

public function postLogin(Request $request) {
    //do stuff
}

vs using your custom request where the validation is

public function postLogin(LoginRequest $request){
    //do stuff
}

22nd April, 2016

kreierson left a reply on Giving Routes Of Different Kinds With Same URL The Same Name? • 1 year ago

Yeah that's fine. In fact if you do

Route::resource('view', 'PostController');

Then all those routes will be set up for you. Then in your terminal run php artisan route:list to view the routes that will set up for you

6th April, 2016

kreierson left a reply on "Web" Middleware In Laravel 5.2 • 1 year ago

Well this makes sense now, I was having issues flashing a message to the session as I am in development on a new project. It was working fine, but then did a composer update and flash messaging broke. I removed the web middleware group in my routes file and everything is working great now.

29th March, 2016

kreierson left a reply on Mail - From Address • 1 year ago

Thanks for the reply otepas. Mandrill does add the domain automatically but still rejects the email. The domain I am testing with is set up on GoDaddy and does have MX records configured. I decided to give Mailgun a try instead of Mandrill. Mailgun, once you have your domain configured allows you to send from any address. Depending on the recipients email provider it may show sent via "yourdomain.com" next to the from address/name, which I actually like because it's kind of a little free marketing I suppose.

kreierson started a new conversation Mail - From Address • 1 year ago

I'm looking to give my clients the ability to send emails to their customers. I was planning on using Mandrill. I can send emails just fine if I send from an email that belongs to one of my sending domains. Is it possible to change the from address to my clients email address? Currently it seems there is not using Mandrill.

 Mail::send('emails.test', [], function($message)
          {
               $message->to('clientsCustomer@customer.com')
                         ->from('clientsEmail@example.com', 'Client Name')
                         ->subject('Hello, this is a test');
                    
          });

I can add in the replyTo and that would be ok, but I would really like it to actually have my clients email rather than an email from my domain. Any thoughts?

Thanks,

15th February, 2016

kreierson left a reply on Save Form To Table • 1 year ago

In your controller, make sure you use App\Country at the top. Then typehint your Country model in your addCountry Method.

use App\Country;

public function addCountry(Country $country)
{
    $country->name = Input::get('name');
     /*$user->email = Input::get('email');
     $user->password = Hash::make(Input::get('password'));*/
        $country->save();

     return Redirect::back();
}

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.