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

FutureWeb

FutureWeb

Member Since 6 Years Ago

Experience Points
36,415
Total
Experience

3,585 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
345
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

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

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

Level 8
36,415 XP
Nov
23
2 days ago
Activity icon

Started a new Conversation Custom Valet Nginx Conf

Hi Guys,

I am looking to add a site specific Nginx conf using Valet is this possible ? its not a Laravel app just a vanilla PHP site which has some quirky routing.

I have set up homestead and managed to configure it all as a VM but now vagrant has fell over and I can't get it back up.

Nov
21
4 days ago
Activity icon

Started a new Conversation Best Way To Sanitize Strings

I know this isn't a one fits all thing but I deal with a ton of rubbish data every day, normally in the form of datafeeds which need to be ingested in to MySQL tables.

common issues are:

special chars in strings some html in strings but preserve headings, paragraphs, line breaks and lists but strip out any styles

whats in your opinion is the best way to sanitize a string based on the above?

Nov
02
3 weeks ago
Activity icon

Awarded Best Reply on Laravel 8 Routes Broken

Turns out default NGINX config was to blame !

Activity icon

Replied to Laravel 8 Routes Broken

Turns out default NGINX config was to blame !

Activity icon

Replied to Laravel 8 Routes Broken

<?php

namespace App\Providers;

use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Route;

class RouteServiceProvider extends ServiceProvider
{
    /**
     * This namespace is applied to your controller routes.
     *
     * In addition, it is set as the URL generator's root namespace.
     *
     * @var string
     */
    protected $namespace = 'App\Http\Controllers';

    /**
     * The path to the "home" route for your application.
     *
     * @var string
     */
    public const HOME = '/home';

    /**
     * Define your route model bindings, pattern filters, etc.
     *
     * @return void
     */
    public function boot()
    {
        //

        parent::boot();
    }

    /**
     * Define the routes for the application.
     *
     * @return void
     */
    public function map()
    {
        $this->mapApiRoutes();

        $this->mapWebRoutes();

        //
    }

    /**
     * Define the "web" routes for the application.
     *
     * These routes all receive session state, CSRF protection, etc.
     *
     * @return void
     */
    protected function mapWebRoutes()
    {
        Route::middleware('web')
            ->namespace($this->namespace)
            ->group(base_path('routes/web.php'));
    }

    /**
     * Define the "api" routes for the application.
     *
     * These routes are typically stateless.
     *
     * @return void
     */
    protected function mapApiRoutes()
    {
        Route::prefix('api')
            ->middleware('api')
            ->namespace($this->namespace)
            ->group(base_path('routes/api.php'));
    }
}
Nov
01
3 weeks ago
Activity icon

Replied to Laravel 8 Routes Broken

local env works production doesn't I think this is the key

Activity icon

Replied to Laravel 8 Routes Broken

no joy surely if search matches it would pick up the search route as its specific and any other string would match the wildcard

Activity icon

Replied to Laravel 8 Routes Broken

via git with forge running composer update after each pull

Activity icon

Replied to Laravel 8 Routes Broken

still no joy im afraid

Activity icon

Replied to Laravel 8 Routes Broken

nope its not lol - I am completely stumpt

Activity icon

Replied to Laravel 8 Routes Broken

I Bet its cloudflare proxying requests ?

Activity icon

Replied to Laravel 8 Routes Broken

Yep ran composer install and just installed the standard laravel ui and auth

Activity icon

Replied to Laravel 8 Routes Broken

Yeah I tried that

Activity icon

Replied to Laravel 8 Routes Broken

It seems like all post routes don't work the auth ones don't either - is there something Laravel 8 specific that needs importing for post routes to work?

That said all work in my local env macbook pro, production is digital ocean ubuntu 18.0.4 / forge provisioned LEMP stack

Activity icon

Replied to Laravel 8 Routes Broken


use App\Http\Controllers\DealsController;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;

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

// front end routes:

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

//Networks
Route::get('/networks/{slug}','[email protected]');

// buy
Route::get('/buy/{deal}','[email protected]');

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

// deal
Route::get('/deal/{deal}','[email protected]');

Route::post('/{phone}', [DealsController::class, 'ajax']);
//Route::post('/{device}', '[email protected]');
Route::get('/{phone}', '[email protected]');

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

//Route::get('/test',function(){
//    $feeds = (new App\Http\Controllers\DatafeedController)->parseXml('buymobiles.xml');
//
//});

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


/** Admin Routes */

//Retailers
Route::get('/admin/retailers','[email protected]')->middleware('auth');
Route::get('/admin/retailers/create','[email protected]')->middleware('auth');
Route::post('/admin/retailers/create','[email protected]')->middleware('auth');
Route::get('/admin/retailers/{retailer}','[email protected]')->middleware('auth');
Route::post('/admin/retailers/{retailer}','[email protected]')->middleware('auth');
Route::post('/admin/retailers/destroy/{retailer}','[email protected]')->middleware('auth');

// Retailers -> Datafeeds
Route::get('/admin/retailers/{retailer}/datafeeds','[email protected]')->middleware('auth');
Route::get('/admin/retailers/{retailer}/datafeeds/create','[email protected]')->middleware('auth');
Route::post('/admin/retailers/{retailer}/datafeeds/create','[email protected]')->middleware('auth');
Route::get('/admin/retailers/{retailer}/datafeeds/{datafeed}','[email protected]')->middleware('auth');
Route::post('/admin/retailers/{retailer}/datafeeds/{datafeed}','[email protected]')->middleware('auth');
Route::get('/admin/retailers/{retailer}/datafeeds/{datafeed}/destroy','[email protected]')->middleware('auth');

// Retailers -> Datafeeds -> Schedules
Route::get('/admin/retailers/{retailer}/datafeeds/{datafeed}/schedule','[email protected]')->middleware('auth');
Route::get('/admin/retailers/{retailer}/datafeeds/{datafeed}/schedule/create','[email protected]')->middleware('auth');
//Networks
Route::get('/admin/networks','[email protected]')->middleware('auth');
Route::get('/admin/networks/create','[email protected]')->middleware('auth');
Route::post('/admin/networks/create','[email protected]')->middleware('auth');
Route::get('/admin/networks/{network}','[email protected]')->middleware('auth');
Route::post('/admin/networks/{network}','[email protected]')->middleware('auth');
Route::post('/admin/networks/destroy/{network}','[email protected]')->middleware('auth');

//Products
Route::get('/admin/products','[email protected]')->middleware('auth');
Route::get('/admin/products/create','[email protected]')->middleware('auth');
Route::post('/admin/products/create','[email protected]')->middleware('auth');
Route::get('/admin/products/{product}','[email protected]')->middleware('auth');
Route::post('/admin/products/{product}','[email protected]')->middleware('auth');
Route::post('/admin/products/destroy/{product}','[email protected]')->middleware('auth');

//Product -> Versions
Route::get('/admin/products/{product}/version','[email protected]')->middleware('auth');
Route::get('/admin/products/{product}/version/create','[email protected]')->middleware('auth');
Route::post('/admin/products/{product}/version/create','[email protected]')->middleware('auth');
Route::get('/admin/products/{product}/version/{productVersion}','[email protected]')->middleware('auth');
Route::post('/admin/products/{product}/version/{productVersion}','[email protected]')->middleware('auth');
Route::post('/admin/products/{product}/version/destroy/{productVersion}','[email protected]')->middleware('auth');

//Product -> Versions -> Editions
Route::get('/admin/products/{product}/{productVersion}/edition','[email protected]')->middleware('auth');
Route::get('/admin/products/{product}/{productVersion}/edition/create','[email protected]eate')->middleware('auth');
Route::post('/admin/products/{product}/{productVersion}/edition/create','[email protected]')->middleware('auth');
Route::get('/admin/products/{product}/{productVersion}/edition/{productEdition}','[email protected]')->middleware('auth');
Route::post('/admin/products/{product}/{productVersion}/edition/{productEdition}','[email protected]')->middleware('auth');
Route::post('/admin/products/{product}/{productVersion}/edition/destroy/{productEdition}','[email protected]')->middleware('auth');

// Product -> versions -> editions -> identifiers
Route::get('/admin/products/{product}/{productVersion}/edition/{productEdition}/identifier','[email protected]')->middleware('auth');
Route::get('/admin/products/{product}/{productVersion}/edition/{productEdition}/identifier/store','[email protected]')->middleware('auth');
Route::post('/admin/products/{product}/{productVersion}/edition/{productEdition}/identifier/{identifier}','[email protected]')->middleware('auth');
Route::post('/admin/products/{product}/{productVersion}/edition/{productEdition}/identifier/{identifier}/destroy','[email protected]')->middleware('auth');

// Product -> versions -> editions -> features
Route::get('/admin/products/{product}/{productVersion}/edition/{productEdition}/features','[email protected]')->middleware('auth');
Route::post('/admin/products/{product}/{productVersion}/edition/{productEdition}/features/{features}','[email protected]')->middleware('auth');
Route::post('/admin/products/{product}/{productVersion}/edition/{productEdition}/features/{features}/destroy','[email protected]')->middleware('auth');

// Product -> versions -> editions -> specifications
Route::get('/admin/products/{product}/{productVersion}/edition/{productEdition}/specifications','[email protected]')->middleware('auth');
Route::post('/admin/products/{product}/{productVersion}/edition/{productEdition}/specifications/{specifications}','[email protected]')->middleware('auth');
Route::post('/admin/products/{product}/{productVersion}/edition/{productEdition}/specifications/{specifications}/destroy','[email protected]')->middleware('auth');

//Tariff Group]
Route::get('/admin/tariff-group','[email protected]')->middleware('auth');
Route::get('/admin/tariff-group/create','[email protected]')->middleware('auth');
Route::post('/admin/tariff-group/create','[email protected]')->middleware('auth');
Route::get('/admin/tariff-group/{tariffGroup}','[email protected]')->middleware('auth');
Route::post('/admin/tariff-group/{tariffGroup}','[email protected]')->middleware('auth');
Route::post('/admin/tariff-group/destroy/{tariffGroup}','[email protected]')->middleware('auth');

//Tariff details
Route::get('/admin/tariff-group/{tariffGroup}/tariffs','[email protected]')->middleware('auth');
Route::get('/admin/tariff-group/{tariffGroup}/tariffs/{tariff}','[email protected]')->middleware('auth');

// Tariff allowances
Route::get('/admin/tariff-group/{tariffGroup}/tariffs/{tariff}/allowances','[email protected]')->middleware('auth');

// Sales
Route::post('/admin/sales','[email protected]');

Auth::routes();

Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
Activity icon

Replied to Laravel 8 Routes Broken

DealsController

Activity icon

Replied to Laravel 8 Routes Broken

No none

Activity icon

Replied to Laravel 8 Routes Broken

no joy im afraid :(

Activity icon

Replied to Laravel 8 Routes Broken

No it doesn't happen on dev interestingly the autocomplete also doesn't work in production but does in dev

Activity icon

Replied to Laravel 8 Routes Broken

I should be able to define multiple to the same uri get, post, put, patch, delete etc should determine which method is hit?

Activity icon

Replied to Laravel 8 Routes Broken

yep controllers imported at the top of web.php

Activity icon

Replied to Laravel 8 Routes Broken

Hmm nothing from the dd but have just noticed event though the get route works it too returns a 404 the route shows in route:list

very much a work in progress but you can see it in action here: https://shopmobilephones.co.uk/iphone-11 click on one of the options in the left hand filters like no up front cost to trigger an ajax call

Activity icon

Started a new Conversation Laravel 8 Routes Broken

I have upgraded to laravel 8 and now my post ajax routes return a 404?

		Route::post('/{phone}', '[email protected]');
                    Route::get('/{phone}', '[email protected]');

I have also tried:

		Route::post('/{phone}', [DealsController::class, 'ajax']);

but still when ajax is called the route returns a 404 csrf token is sent in the payload along with the model ID and other params (the query in the controller works and returns json data)

Activity icon

Replied to My Route Is Not Working In Laravel 8.

Thanks will do get route works its the post route thats the issue

Activity icon

Replied to My Route Is Not Working In Laravel 8.

Sorry to jump in on the thread but I have upgraded to laravel 8 and now my post ajax routes return a 404?

			Route::post('/{phone}', '[email protected]');
                            Route::get('/{phone}', '[email protected]');

I have tried the suggestion above to clear cached routes but doesn't seem to work any help would be very much appreciated.