moprocto

moprocto

Member Since 3 Years Ago

Experience Points 4,620
Experience Level 1

380 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 0
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

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

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

22 Jan
5 months ago

moprocto left a reply on Track Bounces With Laravel Mailer

@JEKINNEY - If I use Mailgun, can I get an ID returned with each email and then immediately query the ID for successful delivery?

moprocto started a new conversation Track Bounces With Laravel Mailer

Hi,

I use the Laravel mailer to send generic reminders to my users. However, with each execution, I want to know if that email bounced or not. How can I update my code to capture that information?

            $message->to($email, $name)
            ->subject("$subject");
                $message->from("[email protected]",'Toy Story');
$message->sender("[email protected]",'Toy Story');
            });
05 Dec
7 months ago

moprocto started a new conversation How Can I Backup A Laravel Project To Box?

I use Forge and AWS to manage laravel project deployments. I can take snapshots with AWS, but that requires me to manually login. It's not super obvious how I can setup an automatic GFS rotation at the file level and possible transport the backups via BOX's FTP. How do you backup your projects and do you know how I can incorporate Box into my setup?

14 Nov
8 months ago

moprocto left a reply on Remove "on Behalf Of" When Sending Mail With Mailgun

ugh.... here's the solution

Mail::send(['html' => 'emails.generic'], $data, function($message) use ($subject, $email, $name){
            $message->to($email, $name)
            ->subject("$subject");
                $message->from("[email protected]",'Toy Story');
        $message->sender("[email protected]",'Toy Story');
            });

there's no documentation (that I could find) stating you have to add ->sender to remove the "on behalf of".

moprocto started a new conversation Remove "on Behalf Of" When Sending Mail With Mailgun

I send simple emails with Mailgun's SDK, but when I view the emails with outlook, it has this stuck at the top:

[email protected] on behalf of Toy Story <[email protected]>

the domain of the web server is portal.cowboy.org but emails from the server are [email protected]

my Mailgun code looks like this

Mail::send(['html' => 'emails.generic'], $data, function($message) use ($subject, $email, $name){
            $message->to($email, $name)
            ->subject("$subject");
                $message->from("[email protected]",'Toy Story');
            });

What do I need to do to make it so that the user sees:

Toy Story <[email protected]>

?

14 Aug
11 months ago

moprocto left a reply on Laravel Scout: How To Score Results By Overlap In First Word?

@lostdreamer_nl I converted this topic to be more focused on Scout. I think I've narrowed my query immensely. Any thoughts to share? :)

13 Aug
11 months ago

moprocto left a reply on Search MySQL Database And Sort By Relevancy?

@newbie360

Hmmm results are getting interesting

Array
(
    [id] => 8903
    [title] => marketing director
    [custom] => 1
    [user_id] => 7
    [score] => 17.577541351318
)
Array
(
    [id] => 8872
    [title] => Executive Director
    [custom] => 1
    [user_id] => 7
    [score] => 9.1590795516968
)
Array
(
    [id] => 8906
    [title] => funeral director
    [custom] => 1
    [user_id] => 7
    [score] => 9.1590795516968
)
Array
(
    [id] => 8820
    [title] => Marketing rep
    [custom] => 1
    [user_id] => 8
    [score] => 8.4184608459473
)
Array
(
    [id] => 8857
    [title] => Marketing Specialist
    [custom] => 1
    [user_id] => 7
    [score] => 8.4184608459473
)
Array
(
    [id] => 8862
    [title] => Content Marketing Specialist
    [custom] => 1
    [user_id] => 7
    [score] => 8.4184608459473
)

moprocto left a reply on Search MySQL Database And Sort By Relevancy?

@newbie360 great question! it appears that method leads me to a similar issue with scoring.

Array
(
    [id] => 8872
    [title] => Executive Director
    [custom] => 1
    [user_id] => 7
    [score] => 9.1590795516968
)
Array
(
    [id] => 8903
    [title] => marketing director
    [custom] => 1
    [user_id] => 7
    [score] => 9.1590795516968
)
Array
(
    [id] => 8906
    [title] => funeral director
    [custom] => 1
    [user_id] => 7
    [score] => 9.1590795516968
)

moprocto left a reply on Search MySQL Database And Sort By Relevancy?

@lostdreamer_nl So I've got elasticsearch running! :D :D and I get this when searching job titles matching director.

array:4 [▼
  "took" => 155
  "timed_out" => false
  "_shards" => array:4 [▶]
  "hits" => array:3 [▼
    "total" => 3
    "max_score" => 1.0
    "hits" => array:3 [▼
      0 => array:5 [▼
        "_index" => "title"
        "_type" => "occupations"
        "_id" => "8872"
        "_score" => 1.0
        "_source" => array:4 [▼
          "id" => 8872
          "title" => "Executive Director"
          "custom" => 1
          "user_id" => 7
        ]
      ]
      1 => array:5 [▼
        "_index" => "title"
        "_type" => "occupations"
        "_id" => "8903"
        "_score" => 1.0
        "_source" => array:4 [▼
          "id" => 8903
          "title" => "marketing director"
          "custom" => 1
          "user_id" => 7
        ]
      ]
      2 => array:5 [▼
        "_index" => "title"
        "_type" => "occupations"
        "_id" => "8906"
        "_score" => 1.0
        "_source" => array:4 [▼
          "id" => 8906
          "title" => "funeral director"
          "custom" => 1
          "user_id" => 7
        ]
      ]
    ]
  ]
]

I noticed they all have a score of 1.0. I can't find documentation on the Laravel website that explains exactly how the score is being generated and how we could specify the calculation method of the score. Any tips?

moprocto left a reply on Search MySQL Database And Sort By Relevancy?

@lostdreamer_nl let me give that a shot and let you know how it goes. Thank you!

moprocto started a new conversation Search MySQL Database And Sort By Relevancy?

I'm trying to create a search system that's a little bit more sophisticated than simply using LIKE %query%. My users can search for other users by their job title. However, job titles are user-generated and can people can use multiple combinations of words/terms to describe the same job CEO vs Chief Executive Officer, Non-profit Executive vs. Non-profit Director, and etc.

I don't find a query containing LIKE %non-profit%helpful because it will return practically every title in the database containing the word non-profit which includes accountants, outreach coordinator, etc.

Ideally, I'd like it so that the results are ranked by relevancy and if someone is looking for a Non-Profit Executive, then Non-Profit Director is the most relevant and Non-Profit Accountant is for example least.

Can someone advise me on how to accomplish this and if Laravel Scout may be useful?

I was considering creating a separate "context" table that helps with the relevancy calculations because MySQL won't know director and executive (in some cases) are interchangeable.

04 Jul
1 year ago

moprocto started a new conversation How Can I Detect If Route Parameter Begins With # With Regular Expression?

I have a blog with hashtags and I want the urls to be super simple. Like myblog.com/#happyfourth but I want it setup so that if the first character after / is a # then it directs to a specific controller versus something like myblog.com/happyfourth which goes to another controller. Any help? :)

I already have this

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

where my head is at:

Route::get('/{hashtag}', '[email protected]')->->where('hashtag','^([0-9A-Za-z\-]+)?#([0-9A-Za-z\-]+)?');name('hashtag');
04 Jun
1 year ago

moprocto left a reply on Better Way To Pass Specific User Id Through Model Relationship?

@Cronix yeah I tried that earlier but the profile relation was nested where I can't easily grab it

Collection {#286 ▼
  #items: array:1 [▼
    0 => Connection {#294 ▼
      #fillable: array:3 [▶]
      #connection: "mysql"
      #table: null
      #primaryKey: "id"
      #keyType: "int"
      +incrementing: true
      #with: []
      #withCount: []
      #perPage: 15
      +exists: true
      +wasRecentlyCreated: false
      #attributes: array:6 [▶]
      #original: array:6 [▶]
      #changes: []
      #casts: []
      #dates: []
      #dateFormat: null
      #appends: []
      #dispatchesEvents: []
      #observables: []
      #relations: array:1 [▼
        "connected" => User {#301 ▼
          #fillable: array:3 [▶]
          #hidden: array:2 [▶]
          #connection: "mysql"
          #table: null
          #primaryKey: "id"
          #keyType: "int"
          +incrementing: true
          #with: []
          #withCount: []
          #perPage: 15
          +exists: true
          +wasRecentlyCreated: false
          #attributes: array:8 [▶]
          #original: array:8 [▶]
          #changes: []
          #casts: []
          #dates: []
          #dateFormat: null
          #appends: []
          #dispatchesEvents: []
          #observables: []
          #relations: array:1 [▼
            "profile" => Profile {#305 ▶}
          ]
          #touches: []
          +timestamps: true
          #visible: []
          #guarded: array:1 [▶]
          #rememberTokenName: "remember_token"
        }
      ]
      #touches: []
      +timestamps: true
      #hidden: []
      #visible: []
      #guarded: array:1 [▶]
    }
  ]
}

moprocto left a reply on Better Way To Pass Specific User Id Through Model Relationship?

@lostdreamer_nl very neat! How can I pull from the model as an object instead of an array?

03 Jun
1 year ago

moprocto started a new conversation Better Way To Pass Specific User Id Through Model Relationship?

Let's say I have a table that stores my user_id in one column and the id of another user in another called connected_to. Let's call that table connections.

In my setup, each user has a profile and I want to grab to profile of the person I'm connected to.

foreach(Connections::where('user_id', Auth::user()->id)->get() as $connection){
    return $connection->user->profile;
}

I can't figure out how to tell it to lookup the user profile based on connected_to instead of user_id

the methods below create errors

    $connection->connected_to->user->profile;
    $connection->connected_to->user()->profile;

I have some alternative ideas, but they include a lot of bloat code ;)

02 Jun
1 year ago

moprocto left a reply on Select Rows From Table Where Pairs Are Unique For User Inbox

@Cronix I went ahead and implemented a conversation_id and it solved my underlying puzzle.

moprocto left a reply on Select Rows From Table Where Pairs Are Unique For User Inbox

@Cronix hmm I do not. Maybe I should XD as that would make things much easier.

moprocto left a reply on Select Rows From Table Where Pairs Are Unique For User Inbox

@Vilfago can you elaborate? I've seen somewhat similar questions on this topic, but they point back to groupBy

moprocto started a new conversation Select Rows From Table Where Pairs Are Unique For User Inbox

I'm trying to build an inbox for a user's private messages. It tracks all conversations you are tied to regardless of whether a response was made (or received). I'm having some challenges trying to use 'distinct' with eloquent and I'm not sure how to formulate my query.

What I want to do: Select from messages table where my user_id appears in the sender and/or receiver column. Only show me the latest message from each conversation.

$messages = DB::table('messages')
                        ->select('*')
                        ->groupBy('sender', 'receiver')
                        ->where('sender', Auth::user()->id)
                        ->orWhere('receiver', Auth::user()->id)
                        ->get();

but it's also going to return messages I sent even if they belong to the same "conversation"? Can anyone help me figure out the next half of the query process?

18 Apr
1 year ago

moprocto left a reply on Laravel For A Multiplayer Game Server. Recommended?

@martinbean that's a fair point. The alternative is c# on azure server, but that bloats our costs by 30% because it will all be outsourced.

moprocto started a new conversation Laravel For A Multiplayer Game Server. Recommended?

I am working on a mobile game (unity) that will allow players to fight each other or together and currently we are looking at game server setups. I prefer to build a game server utilizing Laravel because I know how to program for it. Is Laravel or PHP in general competitive for mobile online gaming yet or should I look elsewhere. My philosophy is "go with what you know" because I like to keep costs down. :)

29 Mar
1 year ago

moprocto left a reply on Pulling Array Of User Registrations Per Month

@jlrdw I don't understand what exactly I'm supposed to write based on your suggestion, unfortunately.

moprocto started a new conversation Pulling Array Of User Registrations Per Month

I am trying to create a table that displays the months in one row (chronologically) and the number of users that have registered in that month in the row below. I created an array like this

$months = [];

foreach($this->all() as $user){
            array_push($months, convertTimestamp($user->date, $pull = "month"));
}
$sorted = array_count_values($months);
$sorted = ksort($sorted);

I get the correct data

 [
 " 12" => 69
  "02" => 40
  "03" => 29
  "04" => 3
  "05" => 5
  "07" => 10
  "06" => 8
  10 => 11
  "08" => 12
  11 => 10
  "09" => 6
  "01" => 22
]

But this is where I'm stuck because I can't sort the "keys" of the array from least to greatest. ksort returns a boolean instead of a sorted array.

dd($sorted) returns true

Is there a laravel helper that I can be pointed to?

28 Mar
1 year ago

moprocto left a reply on Find All Instances In Model Where A Function Will Return True

@rin4ik

I did

<?php

use App\User as Users;

// code


public function dashboard(){
    $users = new Users;

    return $users::scopeCompletedGoalOne()()->paginate();
}

and got the same error. I'm guessing it's me :)

moprocto left a reply on Find All Instances In Model Where A Function Will Return True

@martinbean any idea to get around this error? Non-static method App\User::scopeCompletedGoalOne() should not be called statically

moprocto left a reply on Find All Instances In Model Where A Function Will Return True

@Helmchen I like your suggestion, I also added the following to the model

public function step1(){
        return $this->has('profile', '=', 1)->get();
    }

so I can just do a simple Users::step1();. Hopefully, that is okay?

moprocto started a new conversation Find All Instances In Model Where A Function Will Return True

I have a users table created with a basic make:auth, a posts model, and a friend model. My admin dashboard is tracking user activity in a series of made up "goals". For example: Goal 1 is when a user as made at least one post and made at least one friend. Goal 2 is when a user has made at least three posts, three friends, and finished their profile

I want to see how many users have completed step 1.

In my user model I have (example)

public function goal1(){
if(\App\Post::where('user_id', $this->id)->count() >= 1 && \App\Friend::where('user_id', $this->id)->count() >= 1){
            return true;
        }
        return false;

}

My admin controller is calling in all users


$data = [
"users" => Users::all()
];

My view is spitting out a table where I can see how many users have completed my goals

|_________________________| | Goal | Completed | |---------------------------------| | 1 | {{ $users->where(goal1(),true)->count() }}

I understand that {{ $users->where(goal1(),true)->count() }} is not valid, but how can I achieve that kind of output simply without bloating the model? :)

21 Dec
1 year ago

moprocto left a reply on Can't Boot Up Laravel Applications Within GoDaddy VPS

I was using the wrong PHP version

moprocto started a new conversation Can't Boot Up Laravel Applications Within GoDaddy VPS

Hi,

I am trying really hard to get a laravel 5.5 installation up and running on a GoDaddy VPS, but I am running into perpetual roadblocks. I have composer and laravel installed...but I cannot create any laravel apps

Here is the error I get.

Script php artisan key:generate handling the post-create-project-cmd event returned with error code 1

07 Jun
2 years ago

moprocto started a new conversation How Do I Conduct Spatial Searches With Laravel?

My users enter in lat and long coordinates and I find all restaurants within an X mile radius of the provided coordinates. Each restaurant is stored in a mySQL table with lat and long coordinates.

I found this query on stackoverflow, but how do I use it in Laravel?

SELECT id, ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) * cos( radians( long ) - radians(-122) ) + sin( radians(37) ) * sin(radians(lat)) ) ) AS distance FROM myTable HAVING distance < 50 ORDER BY distance

28 Apr
2 years ago

moprocto left a reply on Create A Second Maria DB On Forge Server For Testing

The problem was a lot simpler than I was making it out to be. I used SequelPro to connect to my Forge instance's MariaDB and simply created a new database. I changed the testing site's .env to only read / write to the newly created database and it works like a charm.

moprocto started a new conversation Create A Second Maria DB On Forge Server For Testing

Can someone walk me through the command line steps of booting up another Maria DB instance on a Forge Server that already has one? I am trying to have two instances with two separate credentials...one for testing and another for production.

26 Apr
2 years ago

moprocto left a reply on How Can I Have A User Model With If Statements?

Cronix, I had it like that before, but it was costing me too much to have two separate EC2 instances. I have a www.domain.com and a test.domain.com setup with each subdomain pointing to a folder on the instance...there is a separate laravel instance in each folder. I also have a master branch and dev branch. Whenever I push to dev, the test.domain.com instance gets auto-updated and similar for the live instance.

moprocto started a new conversation How Can I Have A User Model With If Statements?

I am running a test environment and live environment on one forge server. The downside is that both laravel applications are pinging the same maria db instance. I am duplicating all of the live version's table and putting dev_ in the front so that the dev environment only targets those tables for reading and writing.

is it possible to use some kind of "if" statement approach inside the models

example

if(getenv('app_mode') == "dev"){
    protected $table = "dev_users";
} else {
    protected $table = "users";
}
12 Dec
2 years ago

moprocto left a reply on Creating HTML Driven PDFs With L 5.3

@DirkZz yeah the export is basically one large table that spans 3 pages :/

moprocto started a new conversation Creating HTML Driven PDFs With L 5.3

What is everyone using to create PDFs? I've tried https://github.com/elibyy/tcpdf-laravel but it does not like

    lists or images. I run into this error when trying to use lists

    ErrorException in tcpdf.php line 16916:
    Undefined index: rows
    

    and the page never loads when trying to use an image

31 Oct
2 years ago

moprocto left a reply on Socialite: SessionGuard.php Line 439: Argument 1 Passed To Illuminate\Auth\SessionGuard::login()

Progress:

This probably not the answer... but I truncated the social_accounts table and deleted the user attached to my Facebook account's email and the system works again. This was extremely bizarre.

moprocto left a reply on Socialite: SessionGuard.php Line 439: Argument 1 Passed To Illuminate\Auth\SessionGuard::login()

Progress:

var_dump($account->user);

returns Null

but $account->user_id returns the real Id of the user as identified in my database.

However, in my controller, I changed

auth()->login($user);

to

Auth::loginUsingId($user); with hopes that I can at least log the user in by their ID....but no I get a NULL on that too and

Auth::check() returns false

moprocto left a reply on Socialite: SessionGuard.php Line 439: Argument 1 Passed To Illuminate\Auth\SessionGuard::login()

@maitrefrantz

here is my controller

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\SocialAccountService;
use Socialite;
use Auth;
use DB;
use App\User as Users;

class SocialAuthController extends Controller
{
    public function redirect()
    {
        return Socialite::driver('facebook')->redirect();
    }

    public function callback(SocialAccountService $service)
    {
        $user = $service->createOrGetUser(Socialite::driver('facebook')->user());
        print_r($user);
        var_dump($user);
        //auth()->login($user);

        //return redirect()->to('/social/fb');
    }

 
}

I think I narrowed the issue down to

$user = $service->createOrGetUser(Socialite::driver('facebook')->user());

returning Null

moprocto started a new conversation Socialite: SessionGuard.php Line 439: Argument 1 Passed To Illuminate\Auth\SessionGuard::login()

I followed this tutorial line by line https://blog.damirmiladinov.com/laravel/laravel-5.2-socialite-facebook-login.html#.WBfgxJMrJxg to integrate FB login into my app. I am using L5.2 and not 5.3. For some reason, I get the error

 ErrorException in SessionGuard.php line 439: Argument 1 passed to Illuminate\Auth\SessionGuard::login() must implement interface Illuminate\Contracts\Auth\Authenticatable, null given

I have never seen this before and I can't figure out why the user is not being created before login attempt

28 Oct
2 years ago

moprocto left a reply on How Can I JOIN 4 Tables In One Call With Laravel?

@willvincent thank you for the extended response. Yes, I have indexed all of my tables thanks to your suggestions on another topic. I was able to get the load time to 8 - 10 seconds down from 60 to 90 seconds. I am currently using Forge to deploy servers with MariaDB installed by default. Allow users to search for used cars is pretty much all we need this static data for.

moprocto left a reply on How Can I JOIN 4 Tables In One Call With Laravel?

@willvincent am I correct to assume that there is a way to improve how I get search results data? I'm able to pull about 200 cars in 10 seconds, but I think I can do better. I believe a lot of resources are being used up inefficiently as described in my initial post.

moprocto left a reply on How Can I JOIN 4 Tables In One Call With Laravel?

@jaydeluca would my model look like this?

    public function photos()
    {
        return $this->hasMany('App\carPhotos', 'vin');
    }

    public function features()
    {
        return $this->hasMany('App\carFeatures', 'vin');
    }

    public function favorites()
    {
        return $this->hasMany('App\CarFavorites, 'vin');
    }

moprocto started a new conversation How Can I JOIN 4 Tables In One Call With Laravel?

I have a static database that contains information on used cars. There are 4 tables

Table 1: usedCar // general info about car (100,000 rows) Table 2: usedCarFeatures // list of features available with car (2,000,000 rows) Table 3: usedCarPhotos // list of photos for each car (20,000,000 rows) Table 4: usedCarFavorites // people who favorited the car (1,000,000 rows)

The VIN number is stored in tables 2,3, and 4

when a user conducts a search, our app connects with an API to get the VIN number of the vehicle that best matches their filter

foreach($vinNumbers as $vin){
    $car = Cars::where('vin', $vin)->first();
    $photos = CarPhotos::where('vin', $vin)->get();
    $features = CarFeatures::where('vin', $vin)->get();
    $favorites = CarFavorites::where('vin', $vin)->get();
}

I believe the above process is inefficient and wastes a lot of resources. How can I do a join across all 4 databases via the VIN while maintaining the simplicity of the above? I love the fact that I can through the photos, features, and favorites variables into a loop and manipulate as I please.

18 Oct
2 years ago

moprocto started a new conversation How Can I Improve App Performance With MariaDB Database Containing 25 Million Records?

[L 5.2]

Laravel has made developing easy for me so far and I enjoy how easy it is to pull data from the database with simple, eloquent code. Now that my database has over 25 million rows, I am seeing significant performance degradation even after boosting my Forge server to m4.2xlarge 8vpCPU count 32 GiB RAM High Network Performance 1,000 Mbps (EBS-Optimized)

I can no longer use code like this

$cars = UsedCars::where('code',$code)->first();

Does anyone have any tips as to how I can improve my code?

03 Oct
2 years ago

moprocto started a new conversation How To Create Subdomains And Link Route 53 To Forge

I migrated my domain to AWS' Route 53. It is not intuitive to me as to how I can create subdomains that point to my Forge Instance. I created an A Record

*.domainname.com

which points to the IP address of my Forge server.

I type sub.domainname.com into the address bar after an hour and nothing happens...well actually, my ISP tells me the address is invalid.

I go to my forge instance and edit the nginx configuration file

It had this

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name domainname.com;
    root /home/forge/domainname.com/public;

    # FORGE SSL (DO NOT REMOVE!)
    ssl_certificate /etc/nginx/ssl/domainnamecom/119183/server.crt;
    ssl_certificate_key /etc/nginx/ssl/domainname.com/119183/server.key;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
    ssl_prefer_server_ciphers on;
    ssl_dhparam /etc/nginx/dhparams.pem;

    index index.html index.htm index.php;

    charset utf-8;

    # FORGE CONFIG (DOT NOT REMOVE!)
    include forge-conf/domainname.com/server/*;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log off;
    error_log  /var/log/nginx/domainname.com-error.log error;

    error_page 404 /index.php;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }
}

I made a copy of it replaced server_name domainname.com; with server_name sub.domainname.com;

Has anyone been able to setup subdomains between AWS' Route 53 and Forge successfully?

16 Sep
2 years ago

moprocto left a reply on How To Run A Simple Cron Job With L 5.2 And Forge?

@SaeedPrez I got it working. This is super cool! thank you

moprocto left a reply on How To Run A Simple Cron Job With L 5.2 And Forge?

@SaeedPrez I will give this a shot tonight! thanks...hopefully the syntax isn't too off

moprocto started a new conversation How To Run A Simple Cron Job With L 5.2 And Forge?

I have an API endpoint that I want to ping three times a week with Guzzle. I am able to successfully initiate a pinging script by manually navigating to a route which then activates the function in my controller. However, I want that controller function to fire without me physically navigating to it. How can I setup Forge to initiate a function, located within a controller, on a schedule? A step-by-step would be beyond awesome!