chrislentz

chrislentz

Member Since 4 Years Ago

Experience Points 12,380
Experience Level 3

2,620 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 137
Lessons
Completed
Best Reply Awards 1
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

15 May
1 week ago

chrislentz started a new conversation How Can I Mock A Different Model To Retrieve A Polymorphic Relationship?

I have 3 data models, one of which extends the other:

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Opinion extends Model
{
    public function reactions()
    {
        return $this->morphMany('App\Models\Reaction', 'reactable');
    }

    ...
}
namespace App\Models\Activity;

use App\Models\Opinion;

class ActivityOpinion extends Opinion
{
    ...
}
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Reaction extends Model
{
    public function reactable()
    {
        return $this->morphTo();
    }

    ...
}

The App\Models\Opinion model has a polymorphic relationship with the App\Models\Reaction model. I can retrieve all of the App\Models\Opinion reactions no problem, so I know the relationship works great.

My question is, how can I retrieve the same set of reactions from the App\Models\Activity\ActivityOpinion model? Because right now, it is looking for App\Models\Activity\ActivityOpinion as the relationship but I need it to look for App\Models\Opinion. Is it possible to mock another model in a polymorphic relationship?

I have tried messing with morphMap which I am already using in the project for another area, but I can't assign 2 different models to a single key in the morphMap.

26 Mar
1 year ago

chrislentz left a reply on Is It Possible To Have Horizon Under A Different Subdomain/route?

I found a hidden undocumented config option for horizon.middleware adding this to the published config file allowed me to set a custom Middleware to support the sub domain and custom gates.

chrislentz started a new conversation Is It Possible To Have Horizon Under A Different Subdomain/route?

I don't use the standard "web" group or middleware group. I have one called "cp" for control panel and I use that with a "cp.domain.com" subdomain in my routes. I am trying to figure out how I can have "cp.domain.com/horizon" as my horizon route. When I do that, I get a "Class web does not exist" error.

Has anyone managed to accomplish this?

17 Feb
2 years ago

chrislentz started a new conversation Relationship Suggestion

I have a concept for a relationship in my mind, but I am not really sure how I should accomplish it. I am rebuilding a site and want to make sure my relationships this time around are proper and allow for scaling.

Here is the concept: I have different types of mentions. When you are adding a comment, a blog post, or a message board post, you can mention multiple things (i.e. Type '#' and type, then select what you want to mention). The complexity is that you can mention users, actors, movies, or tv shows.

I like the idea of having everything in one "mentions" table as a polymorphic. But because I have multiple models on both sides, I am not sure if a dual polymorphic table is possible and if it would be a nightmare to work with. Or, should I do do individual many to many tables for each place mentions can occur (i.e. "blog_mentions", "message_board_mentions", ...) and have the "what was mentioned" as the only polymorphic component in each table?

Would love to hear everyone's thoughts. Thanks!

01 Dec
2 years ago

chrislentz left a reply on Does Anyone Know How To Use "group By" With A Polymorphic Relationship?

Ok, so it turns out that the issue was related to MySQL strict mode, which includes ONLY_FULL_GROUP_BY mode.

I disabled strict mode at the Laravel level and the query is now working as expected. Just set to strict to false in the database config file for your connection.

'strict' => false,
20 Nov
2 years ago

chrislentz started a new conversation Does Anyone Know How To Use "group By" With A Polymorphic Relationship?

I have the following relationship:

return $this->morphedByMany('App\Models\Movie', 'listable', 'cnt_lists', 'list_id')->withPivot('id', 'order', 'updated_at')->where('movies.has_poster', true)->orderBy('order', 'desc')->withTimestamps();

That relationship produces this query:

select `movies`.*, `cnt_lists`.`list_id` as `pivot_list_id`, `cnt_lists`.`listable_id` as `pivot_listable_id`, `cnt_lists`.`id` as `pivot_id`, `cnt_lists`.`order` as `pivot_order`, `cnt_lists`.`updated_at` as `pivot_updated_at`, `cnt_lists`.`created_at` as `pivot_created_at` from `movies` inner join `cnt_lists` on `movies`.`id` = `cnt_lists`.`listable_id` where `movies`.`has_poster` = '1' and `cnt_lists`.`list_id` in ('3176', '3283', '3285', '3287') and `cnt_lists`.`listable_type` = 'App\Models\Movie' order by `order` desc

This relationship works, but it grabs many for each list. I am trying to limit to just one per list. I was originally exploring take() but that limits the whole result set, not a per list limit. I then thought I could group by the cnt_lists.list_id which would grab one per list. This seems to get me what I am looking for. Below is the query that works for me, I am just trying to figure out how to use group by in the relationship because it breaks the relationship when I add it.

select `movies`.*, `cnt_lists`.`list_id` as `pivot_list_id`, `cnt_lists`.`listable_id` as `pivot_listable_id`, `cnt_lists`.`id` as `pivot_id`, `cnt_lists`.`order` as `pivot_order`, `cnt_lists`.`updated_at` as `pivot_updated_at`, `cnt_lists`.`created_at` as `pivot_created_at` from `movies` inner join `cnt_lists` on `movies`.`id` = `cnt_lists`.`listable_id` where `movies`.`has_poster` = '1' and `cnt_lists`.`list_id` in ('3176', '3283', '3285', '3287') and `cnt_lists`.`listable_type` = 'App\Models\Movie' group by `cnt_lists`.`list_id` order by `order` desc
05 Oct
2 years ago

chrislentz left a reply on Scout / Elasticsearch - How Are People Defining Mappings?

@Mithridates @aymanrb I create the indexes, then add the mappings for each model first via the ElasticSearch REST API with Postman. Then I run Laravel Scout to index my models. Then I am using the ElasticSearch PHP SDK directly to do my queries.

I am only using Laravel Scout for the indexing and the model event index updating. Everything else is done directly with ElasticSearch.

24 Sep
2 years ago

chrislentz left a reply on Massive Logs In Old Releases.

After speaking with Taylor, it was determined that I had old Queue works running off the deleted releases, which was causing the massive amounts of logs. I have added a queue restart script into my embed process and it seems to have fixed the issue. All queues are now restarted after the releases have been activated.

21 Sep
2 years ago

chrislentz started a new conversation Massive Logs In Old Releases.

I am having a strange problem. My error logs in old releases grow to gigabytes with in minutes of deployments. What is strange, is that the releases that grow are the old ones, normally the oldest one. Below is the error that fills the log:

[2016-09-22 01:14:48] production.ERROR: ErrorException: include(/home/forge/.../releases/20160922002617/vendor/composer/../bugsnag/bugsnag/src/Report.php): failed to open stream: No such file or directory in /home/forge/.../releases/20160922002617/vendor/composer/ClassLoader.php:414

It repeats multiple times per second until I restart the server. I am thinking, that maybe Envoyer isn't restarting a process that is in progress when it switches to a new release. I am not sure where to start on figuring out how I might be able to fix this. I am guessing I need to build something in to the Envoyer "Deployment Hooks".

Has anyone encountered this? Or give me advice on how I might be able ti fix it?

19 Sep
2 years ago

chrislentz left a reply on How Can You Set Boosts And Filters With Laravel Scout And ElasticSearch?

@wells, Thank you. I ended up sticking with Scout for all of the index creation and updating based on model events, but I switched my search over to utilize the ElasticSearch library directly.

17 Sep
2 years ago

chrislentz started a new conversation How Can You Set Boosts And Filters With Laravel Scout And ElasticSearch?

I am building a search integration with Laravel Scout and Elasticsearch. I am trying to figure out how I can refine my queries for boosting.

Is it possible to do this with Laravel Scout or will I need to revert back to using the ElasticSearch PHP library directly?

05 Sep
2 years ago

chrislentz started a new conversation Scout / Elasticsearch - How Are People Defining Mappings?

I am just getting started with Laravel Scout and I am using the Elasticsearch driver. My question is, what practices are people using to define mappings when using Laravel Scout? Is there away to define data types and boosting details with Laravel Scout?

If I need to do it directly with Elasticsearch, how can I have Laravel Scout create the index, but not import anything until I am able to define all of the Elasticsearch setup?

04 Sep
2 years ago

chrislentz left a reply on Queue Worker Failing W/ Illuminate/Foundation Error

So it turns out the Supervisor works were using a different version of PHP than my CLI and web server. I updated the php path to the correct bin in the worker config and all is well.

chrislentz left a reply on Provision Supervisor Worker On Homestead

I was able to fix the error with some sudo additions.

# Add the laravel service to supervisord
if sudo [ ! -f /etc/supervisor/conf.d/laravel-worker.conf ]; then

  laravel_worker_block="[program:term-worker]
    process_name=%(program_name)s_%(process_num)02d
    command=php /home/vagrant/laravel/artisan queue:work sqs-term --sleep=3 --tries=3
    autostart=true
    autorestart=true
    user=vagrant
    numprocs=8
    redirect_stderr=true
    stdout_logfile=/home/vagrant/laravel/term-worker.log

    [program:default-worker]
    process_name=%(program_name)s_%(process_num)02d
    command=php /home/vagrant/laravel/artisan queue:work sqs-default --sleep=3 --tries=3
    autostart=true
    autorestart=true
    user=vagrant
    numprocs=8
    redirect_stderr=true
    stdout_logfile=/home/vagrant/laravel/default-worker.log"

  sudo sh -c "echo '$laravel_worker_block' > '/etc/supervisor/conf.d/laravel-worker.conf'"
  sudo supervisorctl reread
  sudo supervisorctl update

fi

chrislentz started a new conversation Queue Worker Failing W/ Illuminate/Foundation Error

I am using supervisor to run a queue work and it is failing with the following error: Parse error: parse error, expecting `'&'' or `"variable (T_VARIABLE)"' in /Users/chris/Development/project/repo/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 475

This error shows up repeatedly in the worker logs.

02 Sep
2 years ago

chrislentz started a new conversation Provision Supervisor Worker On Homestead

I am trying to provision a supervisor work via after.sh but for some reason, I keep getting a bunch of permission errors. Anyone have any ideas how I might resolve these?

after.sh

# Add the laravel service to supervisord
if [ ! -f /etc/supervisor/conf.d/laravel-worker.conf ]; then

  laravel_worker_block="[program:tmdb-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /home/vagrant/laravel/artisan queue:work sqs-tmdb --sleep=3 --tries=3
autostart=true
autorestart=true
user=vagrant
numprocs=8
redirect_stderr=true
stdout_logfile=/home/vagrant/laravel/tmdb-worker.log

[program:default-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /home/vagrant/laravel/artisan queue:work sqs-default --sleep=3 --tries=3
autostart=true
autorestart=true
user=vagrant
numprocs=8
redirect_stderr=true
stdout_logfile=/home/vagrant/laravel/default-worker.log"

  echo "$laravel_worker_block" > "/etc/supervisor/conf.d/filmfed-worker.conf"
  supervisorctl reread
  supervisorctl update

fi

ERRORS

==> default: /tmp/vagrant-shell: 38: /tmp/vagrant-shell: cannot create /etc/supervisor/conf.d/laravel-worker.conf: Permission denied
==> default: error: <class 'socket.error'>, [Errno 13] Permission denied: file: /usr/lib/python2.7/socket.py line: 228
==> default: error: <class 'socket.error'>, [Errno 13] Permission denied: file: /usr/lib/python2.7/socket.py line: 228
12 Aug
2 years ago

chrislentz left a reply on What Would Cause Password Hash::check To Start Returning False?

I figured it out, as always, it was a bug else where in my code. The passwords were being changed everytime you saved your account settings.

Thanks.

chrislentz left a reply on What Would Cause Password Hash::check To Start Returning False?

@SaeedPrez The .env has not been edited since 8/2 and the passwords stopped checking on 8/12. But I will definitely keep an eye on it.

chrislentz left a reply on What Would Cause Password Hash::check To Start Returning False?

@SaeedPrez I don't share any data between server and local, so I don't believe that would affects things. My keys and encrypted passwords are env specific.

chrislentz started a new conversation What Would Cause Password Hash::check To Start Returning False?

I am using the standard Hash::check($request->input('password'), $this->user->password) to check if a password matches the saved hash. This works works for a period of a few days, but then after a few days, all of the sudden is starts returning false, even know I have not made any changes. If I use the forgot password and reset the password using Hash::make($request->input('password')) then it starts working again, but stops after a few days.

Does anyone have any theories? It is happening on a cloud server environment and a local environment.

11 Aug
2 years ago

chrislentz started a new conversation How Would You Build A User Feed With Laravel?

My site, http://filmfed.com, has a series of different features which members can interact with. For example, a member can add movie ratings and reviews, they can post blog comments, and they can add entries to the message board.

On the users profile, I want to add add a feed that will collect the members interaction from all of the features above and combine them into a central feed that orders everything based on the date of interaction.

I originally thought I would just retrieve the individual model instances, then try to combine the collections. With this plan, I am not sure how I would combine the collections based on the timestamp ordering and and allow for pagination.

Is there a better direction? I am open to suggestions. If you agree with my plan, do you know how I can combine the collections and achieve the pagination?

Thanks!

25 Jul
2 years ago

chrislentz left a reply on How Can I Get Posts That Belong To Multiple Tags?

@d3xt3r How do I use whereHas() with the join relationship?

chrislentz started a new conversation How Can I Get Posts That Belong To Multiple Tags?

I have blog posts that belongToMany tags.

class BlogPost extends Model {
    public function tags() {
            return $this->belongsToMany('App\Models\BlogTag', 'cnt_blog_tags', 'blog_post_id', 'blog_tag_id');
        }
}
class BlogTag extends Model {
    public function publishedPosts() {
            return $this->belongsToMany('App\Models\BlogPost', 'cnt_blog_tags', 'blog_tag_id', 'blog_post_id')->published()->orderBy('published_at', 'desc');
    }
}

What I am trying to do is get posts that belong to multiple tags. i.e. get posts that have both tag1 (id=1) and tag2 (id=2).

I have been trying a couple of different things

28 May
2 years ago

chrislentz started a new conversation Multi-Polymorphic Relationship

I am trying to set up a polymorphic relationship that is polymorphic in 2 different directions. Does anyone know how I could achieve with with Laravel relationships?

What I am trying to accomplish: Movies & People can be mentioned in Comments & Posts.

Table:
mentionable_id
mentionable_type - App/Movie or App/Person
source_id
source_type - App/Comment or App/Post

I would like to setup relationships on both sides: Movie Model -> Get Comment Mentions Movie Model -> Get Post Mentions Person Model -> Get Comment Mentions Person Model -> Get Post Mentions Comment Model -> Get Mentioned Movies Comment Model -> Get Mentioned People ...

Is a bi-directional polymorphic relationship even possible? Do I need to do some sort of a custom relationship?

Any help or direction would be greatly appreciated.

02 May
3 years ago

chrislentz left a reply on How Can I Access A Parent Method From Child Component In Vue.js?

The problem was that I was not defining :add-status-class="addStatusClass" on the component on the HTML side.

Everything started working once I added that.

30 Apr
3 years ago

chrislentz started a new conversation How Can I Access A Parent Method From Child Component In Vue.js?

I am trying to call a parent/root level method on a child component in Vue.js, but I keep getting a message saying TypeError: this.addStatusClass is not a function.

Vue.component('spmodal', {
    props: ['addStatusClass'],
    created: function() {
        this.getEnvironments();
    },
    methods: {
        getEnvironments: function() {
            this.addStatusClass('test');
        }
    }
});

new Vue({
    el: '#app',
    methods: {
        addStatusClass(data) {
          console.log(data);
        }
    }
});

Here is a full JSBIN example: http://jsbin.com/tomorozonu/edit?js,console,output

If I call this.$parent.addStatusClass('test'); it works fine, but based on the Vue.js documentation, this is bad practice and I should be using props which is not working.

11 Apr
3 years ago

chrislentz started a new conversation How Do You Do Field Boosting In The Elasticsearch PHP Client?

I am using Elasticsearch for the first time and have the indexing and basic searching down, but I am looking todo some complex searching.

With the PHP client how do you do partial searches and field boosting / relevance?

Here is what I have so far, but I can't get it working. The Elasticsearch documentation is no good.

$movie_params = [
    'index' => env('ES_INDEX'),
    'type' => 'show',
    'size' => 6,
    'body' => [
        'query' => [
            'bool' => [
                'should' => [
                    [
                        'match' => [
                            'title' => [
                                'query' => '*' . $q . '*',
                                'boost' => 2
                            ]
                        ]
                    ],
                    [
                        'match' => [
                            'synopsis' => '*' . $q . '*'
                        ]
                    ]
                ]
            ]
        ]
    ]
];

$client = \Elasticsearch\ClientBuilder::create()->build();

$show_raw_results = $client->search($show_params);
31 Mar
3 years ago

chrislentz left a reply on Looking For A Solid Live Search "@/#" Javascript Plugin.

@usman Thanks for the great recommendation. I have been implementing the jquery-textcomplete library and it is working great. Lots of great features and customization options.

28 Mar
3 years ago

chrislentz started a new conversation Looking For A Solid Live Search "@/#" Javascript Plugin.

I am working on a new feature that will allow people to live search in a textarea for different things depending on if they use a "#" or an "@" symbols. Does anyone have any suggestions of a solid Javascript package or plugin that will help me with the front-end? The backend API for the live search is all setup and the processing of the symbols on submit is also completed.

I am just looking for a solid package to help on the front-end.

For example, if someone types "#10 clover" live search would show "10 Cloverfield Lane". When they click or hit enter on the correct search item, it would replace the hashtag with "#10-cloverfield-lane-2016", which is my unique slug for that record.

26 Mar
3 years ago

chrislentz started a new conversation MorphedByMany Relationship Return Single Random Result?

I have a morphedByMany relationship connecting movies and genres. I am trying to figure out how I can get a a random movie for each genre.

public function movies()
{
     return $this->morphedByMany('App\Models\Movie', 'genreable', 'cnt_genres');
}

I have tried a couple of different things, but I am not having any luck.

28 Feb
3 years ago

chrislentz left a reply on How Can I Combine "styles" Mix In With "sass" Mix When "gulp Watch"?

This is a follow up to an old thread, but I wanted to share that a better solution for this issue.

Thanks to @tomcastleman for the correct answer in another thread. It turns out that you can put css files directly inside your sass mix and it will intelligently compile the sass and merge it with the css files.

elixir(function(mix) {
    mix.sass(['../../../node_modules/github-markdown-css/github-markdown.css', 'app.scss']);
});

Source: https://laracasts.com/discuss/channels/elixir/sass-concatenate-without-cache-file/replies/141441

chrislentz left a reply on Can You Specify OnQueue On The Job Instead Of Dispatch()?

I reached out to Taylor on Twitter and he provided me a cleaner solution. Just update the $connection property on the job.

class MyJob extends Job implements SelfHandling, ShouldQueue
{

    ...

    public $connection;

    ...

    public function __construct(Item $item)
    {
        $this->connection = 'sqs-low';
        $this->item = $item;
    }

   ...

}
27 Feb
3 years ago

chrislentz left a reply on Can You Specify OnQueue On The Job Instead Of Dispatch()?

Found a messy solution in an old pull request. Not sure if it is the best, but it works.

class MyJob extends Job implements SelfHandling, ShouldQueue
{
    ...

    public function queue($queue, $job)
    {
        return Queue::connection('sqs-low')->push($job);
    }

   ...
}
25 Feb
3 years ago

chrislentz started a new conversation Can You Specify OnQueue On The Job Instead Of Dispatch()?

I am working on a project that has 2 queue's configured via SQS. One is for a sync service and another is for mail queue.

I know I can choose queue to use by using $this->dispatch(new SyncPerson($person)->onQueue(’sqs-sync'));but is it possible to flag the queue on the actual job instead of the dispatch call?

The SyncPerson job will always need to be on the "sqs-sync" queue.

chrislentz left a reply on Sass + Concatenate Without Cache File

@tomcastleman Thanks for tagging me from my other thread. I never did figure out how todo this with out of the box Elixir. I will try the accepted solution as it is much cleaner that what I am doing now involving direct Gulp use.

@Phillipp did the accepted answer achieve exactly what you were looking for?

06 Feb
3 years ago

chrislentz left a reply on Supervisor Error: BAD_NAME

Figured it out. I had the conf file in the wrong directory.

/etc/supervisor/laravel_worker_beta.conf

Changed To:

/etc/supervisor/conf.d/laravel_worker_beta.conf

chrislentz started a new conversation Supervisor Error: BAD_NAME

I am using Supervisor per the Laravel Documentation to run queue:work. I am getting the following error after trying to create my supervisor config file.

error: <class 'xmlrpclib.Fault'>, <Fault 10: 'BAD_NAME: laravel_worker_beta'>: file: /usr/lib/python2.7/xmlrpclib.py line: 794

This is my /etc/supervisor/laravel_worker_beta.conf file:

[program:laravel_worker_beta]
process_name=%(program_name)s_%(process_num)02d
command=php /usr/share/nginx/html/beta/current/artisan queue:work sqs --sleep=3 --tries=3 --daemon
autorestart=true
numprocs=1
redirect_stderr=true
stdout_logfile=/usr/share/nginx/html/beta/worker.log

Anyone have any thoughts on what could be causing this issue?

26 Jan
3 years ago

chrislentz left a reply on Issue Deploying Laravel Via DeployBot.

@TylerODonnell Yes, I was actually testing that same solution as you replied. That was the issue. It is a fastcgi_param issue. You have to use $realpath_root to get FastCGI to correctly resolve the symlinks.

Here are some links for others that come across this thread: http://stackoverflow.com/questions/23737627/php-opcache-reset-symlink-style-deployment/23904770#23904770 http://nginx.org/en/docs/http/ngx_http_core_module.html#var_realpath_root

Thanks for your help!

chrislentz left a reply on Issue Deploying Laravel Via DeployBot.

I am thinking this is probably the best approach to call on deployment.

service php5-fpm reload

chrislentz left a reply on Issue Deploying Laravel Via DeployBot.

Ok, I did some research and it looks like php5-fpm caches the symbolic link path so when the link path changes, it doesn't automatically receive the chances.

I am curious how other have solved this problem.

Should I just restart the service with each deployment or can I request a cache update?

chrislentz left a reply on Issue Deploying Laravel Via DeployBot.

@bashy & @TylerODonnell I tried both your solutions (php artisan view:clear & service nginx restart neither worked.

What did work is restarting PHP-FPM service php5-fpm restart.

Do either of you know what sort of caching PHP-FPM is doing?

I am a little concerned that doing a service php5-fpm restart on each deployment will cause it to not be a "Zero Downtime Deployment".

chrislentz left a reply on Issue Deploying Laravel Via DeployBot.

So I confirmed that the symlink is updating correctly after the deployment.

Is there any other kind of caching that laravel does on views? Anything that is maybe in the memory?

This is so strange.

chrislentz left a reply on Issue Deploying Laravel Via DeployBot.

@TylerODonnell That is what I am currently doing to make sure the deployment works. I will check if the symlink is updating correctly prior to the restart.

chrislentz left a reply on Issue Deploying Laravel Via DeployBot.

@bashy It does have releases, but it seems like the current directory is properly symlinked to the correct releases folder.

chrislentz started a new conversation Issue Deploying Laravel Via DeployBot.

Anyone using DeployBot for Laravel deployments?

I have been using it on non-laravel projects for sometime, but just started with a Laravel project.

Everything is setup to have a shared vendor directory, storage directory, and .env.

What I am finding, is that view/blade changes I deploy are not showing up. I have to reboot my server to get them to show up. I tried clearing the storage/views contents on deploy, but that didn't help.

Does Laravel (5.1) do anything else related to view compiling/caching that I might need to do on deployment?

26 Dec
3 years ago

chrislentz left a reply on Chained 'remove' Task Is Not Executing With 'gulp Watch'.

@JeffreyWay Is this possible with Elixir? I can't seem to find any information on why this would work with 'gulp watch' but it does work with 'gulp'.

25 Dec
3 years ago

chrislentz left a reply on Chained 'remove' Task Is Not Executing With 'gulp Watch'.

@IvanBernatovic I upgraded to Elixir v4.1.1 but that did help. As for the package you linked to, it has been abandoned. I think the custom one have is pretty solid. Just not sure why it wont work with 'gulp watch'.

chrislentz started a new conversation Chained 'remove' Task Is Not Executing With 'gulp Watch'.

I have a custom task to clean up some files and folders. This 'remove' task is called in a chain off of 'sass'.

When I run 'gulp' the "base_src + '/css/main.css'" directory get deleted, but it doesn't when I run 'gulp watch'.

How can I have the custom task run during 'gulp watch' when sass is run? The 'styles' task runs in the chain no problem on 'gulp watch'.

var elixir = require('laravel-elixir');
var del = require('del');

var base_src  = 'resources/assets';
var base_dest = 'public/assets';

var Task = elixir.Task;

elixir.extend('remove', function(path) {
    new Task('remove', function() {
        del(path);
    });
});

elixir(function(mix) {

    // Cleanup Destination
    mix.remove(base_dest);

    // Compile SASS
    mix
        .sass('main.scss', base_src + '/css/main.css')
        .styles([
            '/css/main.css',
            '/bower/font-awesome/css/font-awesome.min.css'
        ], base_dest + '/css/all.min.css', base_src)
        .remove(base_src + '/css/main.css');

    // Compile Scripts
    mix.scripts([
        '/bower/jquery/dist/jquery.js',
        '/bower/foundation-sites/dist/foundation.min.js',
        '/js/main.js'
    ], base_dest + '/js/all.min.js', base_src);

    // Copy Static Assets
    mix.copy(base_src + '/images', base_dest + '/images');
    mix.copy(base_src + '/bower/font-awesome/fonts', base_dest + '/fonts');
});