Top 50

I was looking for the same and found this question through Google. I was not able to find a usable Laravel package as of now so I made my own quick ' dirty scraper class based on Goutte (composer require weidner/goutte). Just in case someone finds this page through Google again:

Oldies, folk, electronic, all kinds really. I often try out other people's Spotify playlists from playlists.net to discover new artists in the meantime (Spotify's radio only plays a small collection of artists).

I'm trying to replicate the Email verification lesson in Laravel 5.5 using Dusk for testing. I'm running into an issue where my test procedure does not see the database update after a user has confirmed his registration through the link.

So after completing the verification link the test finds that the user is not verified in the database. However, according to my database the user has been verified successfully and artisan tinker shows that as well..

If I change the line assertSee("Email verified!") to assertSee("foo") the screenschot shows that the user was verified:

I cannot chain the assertDatabaseHas to the $this->browse(...) because that returns a null.

If I take out the last assertDatabaseHas and put it in a separate function, the test succeeds:

Well, since the topic is (unneccessarily) bumped, my 2 cents. I've been out of the PHP loop for the past 10 years, not having been programming at all. Wanting to build my own project, I did some reading PHP development anno 2016 . Within the first three hours of diving into Laravel, I knew it was gold. And I still think it is. However, I was completely new to composer. And to virtualbox. Vagrant. Homestead. Git. Node. Bower. Gulp. Elixir. Laravel. Artisan. And although I think the whining and complaining by dazed067 does not help him one bit, I fully understand his frustrations. Despite all the excellent resources from people like Jeffrey Way and Matt Stauffer, I found the learning curve gruesomely steep. There are very little resources aimed at a true newbee level. Virtually all tutorials assumed a basic level of understanding I simply didn't have.

One of the best introductions in the PHP world is Composer, a dependency manager

A what?

In the past we had to use confusing tooling like Pear (Pair) but Composer makes the entire process easier

Ehh... What process?

So what does it do? It allows us to reuse code and download popular packages

Popular what? What are packages?

If you're curious about all the offerings, you can browse to packagist.org

.. visited the site... completely baffled.. what's this about?

Maybe you want something to do with authentication.. or use a framework like codeception.. or behat.. or phpspec

Ehhmmm.. never heard of those but something tells me this sounds like something that could be interesting very much later on... But uhmm... I just like to download Laravel and get into it? And I'm guessing that packages are pieces of software/code?

And it includes laravel. Now, we have a couple of different ways we can pull in laravel. If you go to the cosumentation, you can find a command line tool that does something like laravel new my-blog and that is all you have to do.

All I have to do for what? Don't I need to download Laravel to use this command line tool? But that's just what I want to do. How do I download it?

However, if you want to instead pull it in through composer, here's how you can do it

Eeeuhmm... Do I want to pull it in through composer? Would I want that? Why? What is the advantage? I still don't understand what composer is. Which option should I choose?

But we have download composer first.

Ahhh pffff this is getting complicated. I guess it's good for something, but I'm still not sure what it does.

(After installation). Now we can set up a new project and require for example phpspec

Uhmm.. okay.. So I take it that composer is used to download software. Great. But why wouldn't I download and unzip phpspec manually, like the old days? I still don't get why it has to be so complicated. What on earth is the advantage of this? We're 5 minutes into the lesson about composer and still I don't have a clue what I need it for?

What I want you to note here is that phpspec itself has a number of dependencies. Notice that for each of the components there aready is a package available.

Hmm allright, I'm starting to understand that there could be something useful here. It's like a quick downloader? Still, I don't know that this has to do with laravel.

Let's list the files .Think of the composer.jswon file as a configuration file. If you give the project to someone else, they can simply do a composer install to pull in everything that I've specified right here.

Huh? If I give the project to someone else, why don't I just give him all the code? Why does it have to be so complicated?

Next, if we take a look at that vendor directory, any packages that we pulled in though composer will be placed right here

Vendor? Why not packages? But yes, I see that there are downloads here. Still don't really get it, I never had problems downloading and unzipping code.

Composer includes a very helpful autoloader out of the box. With the autoloader we can follow a basic convention which allows us to very easily import for example php classes that we might need.

.... I feel we're going deeper and deeper into the woods. It sounds like it's useful but it's going way over my head. Can't we just start with Laravel.... pleeeaaaaasssssseeee?

=============

Once again, this is not meant as criticism, but merely to show how difficult things can be for newbees even despite very helpful resources like Laracasts.

Now, about 1500 hours later, my understanding of the matter completely changed and my largest project ever is live using all of the above software/methods. Largely thanks to Jeffrey, this forum, Matt Staufers blog and Taylor's Laravel documentation. Using composer, bower, gulp, artisan has become second nature now, but boy has it been a tough learning process. Much tougher than it should have been in hindsight. I think this comment I saw in this thread is exemplary of many resources on Laravel:

Anyone programming in PHP should be familiar with composer by now.

We've all been newbees. We've all had to learn everything we know. And everyone's starting level is different. If I had started with Laravel with knowledge of composer, with knowledge of gulp, of dependency management, anything like that, the learning curve would have been much easier. But I didn't have that knowledge, so it was a extremely tough uphill struggle to make sense of it all.

Sure, I fully agree it's not neccessary to fire of a frustrated rant within a community. But while I can understand that people take offense at dazed067's message, I'm surprised by how few people here were able to see past that obvious moment of frustration and actually give constructive feedback, and surprised in how many people were just making fun of how easy it was to get into Laravel.

In my experience it's best to generate these directly in your blade templates based on meta data you stored in the database, although there are packages that can help here like criskonnertz/open-graph. Be careful with user generated content in tags since it looks like it does not escape content.

I don't think it's necessary to mock the topic starter's capabilities, no matter how good Taylor Otwell is.

I use Forge myself and feel that ThomasT has a valid point here. Forge's Terms of Service are remarkably flimsy and one sided There's almost no mention of Forges responsibilities, it's all about the user. It does not offer anything remotely resembling a SLA, in fact it literally does not offer any warranty of any kind. It could certainly use a Data Privacy clause, like most serious hosting providers offer.

That being said, no, there is nothing you can do to prevent Forge (or Taylor) from accessing your data. Forge has root access to your files and databases. The certainty you have is that Taylor cannot afford to risk it. He's got far more to lose from messing with your code than he could gain from it. That's what makes me comfortable enough to use Forge despite the thin ToS.

Btw, I use sweetalert2 a lot in my current project. I especially love the interactive possibilities combined with Ajax requests and chained sweetalert commands. It took me hours to figure this out and there's not much documentation to be found on this part, so let me share that here as well:

Javascript-libraries and Laravel are kind of two separate worlds. Laravel works server-side, javascript works client-side. With Laravel you create views (blade), and in those views you can call all the javascript and html that you want.

Imagine you start with a new project. Install the Infinety/alerts-package with the instructions as mentioned on their page.

Use this for example in your routes file (or in a controller):

Route::get('/', function () {
// Simply shows the blade view resources/home.blade.php
return view('home');
});
Route::post('/justapage', function() {
// This is the message that will show in the sweetalert-popup:
alert()->success('It worked!', 'The form was submitted');
// Redirect back to the page you were looking at
return back();
});

It depends on what you want to to. Do you have problems getting the sweetalert popup to show, or are you looking to easily integrate it in your controllers? If that's what you want, there's a Laravel package that makes that part quite easy:
https://github.com/Infinety/alerts

If you install it according to the instructions, it should work fine.
Please note that it comes with the sweetalert js and css file, which will be put into the public folder when you execute the php artisan vendor:publish --tag=alerts command, so that might overwrite the files you already put into the public folder.

I'm pretty new to Laravel but I'm facing a similar challenge. I want a website and a mobile app to make calls to the same API for similar content. I'm probably going to use JWT tokens for user authentication from the app. You might find this article interesting: https://scotch.io/tutorials/token-based-authentication-for-angularjs-and-laravel-apps
It's written for an AngularJS front-end but still gives good information for setup on the Laravel side.