virgiltu

virgiltu

Member Since 4 Years Ago

San Diego

Experience Points 11,130
Experience Level 3

3,870 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 100
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.

25 Mar
3 hours ago

virgiltu left a reply on Foreach In Blade Directive ?

Never mind figured it out.

24 Mar
1 day ago

virgiltu started a new conversation Foreach In Blade Directive ?

Here is my issue. I have a list of modules in a database and I need to loop through them a lot. I am trying to figure out if there is a simple way to do this. I tryed a blade directive but it does not seem to work as it only seems to dump the txt and not the PHP.

'''' @foreach ($content as $item) @if($item->section == 'home_text1') {!! $item->body !!} @endif @endforeach '''

Really simple if the the item is home_text1 than show value body.

17 Feb
1 month ago

virgiltu left a reply on Blade Checkbox And Eloquent

@JLRDW - I am guessing with laravel there is much much shorter way but this did get it to work.

  $manufacturer->drop_ship = (!request()->has('drop_ship') == '1' ? '0' : '1'); 
  $manufacturer->import_only = (!request()->has('import_only') == '1' ? '0' : '1'); 
   $manufacturer->status = (!request()->has('status') == '1' ? '0' : '1'); 
   $manufacturer->save();

blade

<input type="checkbox" name="status" data-plugin="switchery" data-color="#1bb99a" {{ $manufacturer->status ? 'checked' : ''}} >

if anybody has a shorter way please let me know. I guess I could just pars this out into a function so I dont have to rewrite it.

virgiltu started a new conversation Blade Checkbox And Eloquent

I can do this as a longer version but I am sure there is a short way of doing this and I am missing it.

In my database I have a table Manufacturer and one of the fields is status (boolean) Migration is set to boolean but the database saves it at 0 an 1 . When I try to edit the filed I set the boolean to checked. However that returns ON or OFF ending up in an error.

My Blade checkbox

input type="checkbox" name="status" checked data-plugin="switchery" data-color="#1bb99a" {{ $manufacturer->status ? 'checked' : '' }} >

My Controller

manufacturer::find($request->id)->update($request->all());

I know I could brake down each one but I have a lot of fields and there is no need to brake down the Request.

All the help is appreciated.

14 Feb
1 month ago

virgiltu left a reply on Elquent Relation To VUEjs

actually i think i figured it out. Is this the correct option.

@foreach ($options as $option)
                <option 
                v-for="option in {{ $option->value }}" 
                :value="option.id" 
                :key="option.id"
                   >
                @{{ option.name }}
               </option>
                @endforeach

virgiltu started a new conversation Elquent Relation To VUEjs

I am trying to create a cascade drop down menu. The example is simple. Create an option lets say colors and add colors to it, blue red green etc.

What I did. Create table for both options and value. Create a relation ship has many on the color side. now when I pull do : FYI using blade

  @foreach ($option->value as $value)
         {{ $value->name }}
  @endforeach

I get Green, Blue , Red. - Great that works

Now I am trying to create something like this. https://codepen.io/adnanshussain/pen/KqVxXL

I figured out that I can pull my options in Vue by using this {!! json_encode($options) !!}

however how can I iterate through each option so create the value for the second drop down.

Thank you for all the help. I am still going through tutorials but this one is taking a lot longer that I would like and I honest gave up.

06 Feb
1 month ago

virgiltu left a reply on Submitting Multiple Forms And Fields

@MVD - Thank you, I actually just figured out by looking as some code, and came back to say delete the post. However this is exactly what I was looking for. I will watch the video to make sure I use the best practice.

virgiltu left a reply on Submitting Multiple Forms And Fields

Never mind I figured it out.

name="option[0][option_image]"

virgiltu started a new conversation Submitting Multiple Forms And Fields

I am trying to recreate the functionality of this image. In short you can create an option and inside this option you can add more values.

The code has a table named option and a table called values. Than there is a pivot table between the two. I am guessing this is the best option.

In the create form you can keep adding values as you can see.

My question is. How can I submit multiple value in the same from.

I am guessing this will only be one form with extra value added as text and submitted once the entire from is sent. Maybe I am looking at this wrong. Just wanted to get some ideas.

http://docs.opencart.com/image/catalog-option-edit.png

16 Oct
5 months ago

virgiltu left a reply on Firebase

Not sure how to do it with freebase but I see that you can do it with mdbootrap. There is a free version and also the paid one. Search in the side is called brandflow . Honestly the push notification is simple and you get free ones but I still cant figure out how to use the vue version with Laraval.

https://goo.gl/BbGJoC

13 Sep
6 months ago

virgiltu started a new conversation How To Add Blade Slot In Vue?

I am trying to minimize the amount of times I am using the new vue instance from my pages. I am building an admin panel that has multiple views but I am trying to keep the layout and just add what I need for vue from each page.

Is this the best way of going about it? Again there are a few other pages and I am not sure if i should just keep putting the new vue on each one.

My Layout page.

<script>

        Vue.use(VueMaterial.default)

        
 
 new Vue({
     el: '#app',

        @{{ vue }}

 });




</script>   

My home page

@slot('vue')
 <script>  
 
       
            data: {
                names: ['joe', 'mike', 'alex']
            }
           
       

 
  </script>
@endslot
13 Jun
9 months ago

virgiltu left a reply on App For IPhone/iPad

To be honest I can see a really good use for it. I hate that I cant download the entire play list to watch on the plane. Yes I fly a lot and I see others watch programming tutorials on Udemy. Currently I have to use a YouTube to mp4 and than to load them on my iPad. Y ipad or tablet you ask? Because we don’t have to wait to get till 10k feet in order to watch and I don’t have to pull a bulky laptop out. In any case I really hope we get something at some point.

01 May
10 months ago

virgiltu started a new conversation How To Set One Picture To Default ?

I have been trying to figure this out for about a day and a half now.

I am trying to upload images with something like dropzone js, as it seems to be working well with vue. However how can I set one of the images as default?

Lets say that I upload 5 images but only one need to be default.

Also i am loading all of them in a database as json_encode.

So result will be something like this.

{ "default": "main1.jpg", "images": {

    "img1": "image2.jpg",
    "img2": "image3.jpg"
     }

}

17 Apr
11 months ago

virgiltu started a new conversation "php Artisan Migrate" Works But Not Website

I cant seem to figure out y the php artisan migrate works but not the website.

Under the website i get the nice

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) 

Obvious i have it set correct under the .env as the migration works

I also did

php artisan cache:clear

with no luck. Is there another command i should be doing here to get it to refresh.

Background:: I had another server running and it worked before. I had to update the version and now because I have a password it does not seem to work. If i removed the password from the server it seems to work. Somewhere it seem that my .env file is getting from cache or something.

I very much appreciate it.

virgiltu left a reply on Json Data Type Failing In Migration

So I finally found a resolution. Just install MariaDB 10.2 from the website and since my host still runs 10.1. Amazon E2 has a free instance of MariaDB 10.2 and MySQL 5.7 that support JSON.

This is till a temp solution till a solid MongoD solution is made for laravel.

Thank you all for the ideas. I just hate a work around.

16 Apr
11 months ago

virgiltu left a reply on Json Data Type Failing In Migration

Cronix, you are correct. Sadly I need that as I am looking to store Images links and some product specification. I know that I can do separate tables in this case as the user should be able to filter products by some specifications. Not my favorite. I am actually looking at some MongoD drivers that I found. But I think I need to dive more into Laravel before I move to that.

14 Apr
11 months ago

virgiltu left a reply on Json Data Type Failing In Migration

Multumesc Sergiu

virgiltu left a reply on Alternative To Json Date Type?

Or maybe I am doing something wrong. Anybody has any idea y the migration is failing?

This is my server Information. Database server Server: 127.0.0.1 via TCP/IP Server type: MariaDB Server version: 10.1.31-MariaDB - mariadb.org binary distribution Protocol version: 10 User: [email protected] Server charset: UTF-8 Unicode (utf8)

Here is my migration

 $table->increments('id');
            $table->string('productName');
            $table->string('slug');
            $table->text('description');
            $table->decimal('price', 8,2);
            $table->decimal('dicountPrice', 8,2);
            $table->tinyInteger('discount');
            $table->text('tags');
            $table->unsignedTinyInteger('storeID');
            $table->unsignedTinyInteger('rating');
            $table->boolean('status')->default(true);
            $table->json('specs')->nullable();
            $table->json('images')->nullable();
            $table->decimal('shippingPrice',4,2);
            $table->boolean('freeShipping')->default(false);
            $table->json('comparison')->nullable();
            $table->json('moduless')->nullable();
            $table->timestamps();

Here is the error


 Illuminate\Database\QueryException  : SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json null, `images` json null, `shippingPrice` decimal(4, 2) not null, `freeShip' at line 1 (SQL: create table `admin_products` (`id` int unsigned not null auto_increment primary key, `productName` varchar(191) not null, `slug` varchar(191) not null, `description` text not null, `price` decimal(8, 2) not null, `dicountPrice` decimal(8, 2) not null, `discount` tinyint not null, `tags` text not null,
`storeID` tinyint unsigned not null, `rating` tinyint unsigned not null, `status` tinyint(1) not null default '1', `specs` json null, `images` json null, `shippingPrice` decimal(4, 2) not null, `freeShipping` tinyint(1) not null default '0', `comparison` json null, `moduless` json null, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate utf8mb4_unicode_ci)

virgiltu started a new conversation Alternative To Json Date Type?

Since json is not support in most MySQL installations is there another way to storing Json ? Can I store it as txt? would that be an acceptable solution?

*really wished laravel supported MomgoDB out of the box. what a pain is to deal MySQL and relational tables.

02 Feb
1 year ago

virgiltu left a reply on Move Outside Php

Trust me I know the question was stupid. But as I said before, I was more interested into the non blocking IO. But as somebody here said, I can just build that part of the app in node as an API.

Thanks for all the responses.

virgiltu left a reply on Move Outside Php

My question was more pointed to the async functions and the ability to handle a much larger number of requests than php can.

virgiltu started a new conversation How To Make A Menu Menu With Data From The Database

I am going through some video and I am bit lost. Any help will be appreciate it.

I understand the concept of routes > model > controller and views.

So if I have a view I will pull data from a controller and model via a route.

However if I have a view that @yields a header that includes a menu. How can I make the menu item data available to the header at all times and only calling it once.

I cant imagine that I have to constantly call the database to pull the menu items in each controller and push it to the view. Is there a way for a yield section to pull its own data?

My guess is that I did not go into the tutorial videos far enough.

01 Feb
1 year ago

virgiltu started a new conversation Move Outside Php

Is there a plan for Laravel to ever move outside the php environment. Maybe something like phalconphp or under a nodejs system?

virgiltu left a reply on Mongodb Support For Laravel Package

I honestly left Laravel in favor of Node because of SQL about a year back. I mean at what point do people not realize the disadvantage of a database that was last updated in 2016. Lets throw more servers at it in order to scale is not a very price favorite or computation ideal move. I love laravel dont get me wrong, but I absolutely hate having to deal with SQL. Even presenting that to any of my customers puts me into an edge to lose a customer. If there is anything that any company is trying to walk way from is SQL. When the conversation comes about database, almost all customers say no to SQL, and there for a huge reason y laravel is never a an option for a project.

In any case today was my first day back to Laravel in some time, and yes I paid for the subscription plan all this time. I was just in hopes to see some changes in the database department. Guess not.

25 Sep
2 years ago

virgiltu started a new conversation Relationships With Eloquent

I though that maybe I am doing something wrong, but after doing it numerouse times, I keep getting the same result.

I am fallowing this video but I always get NULL when asking for $f->actors. Any ideas.

https://laracasts.com/series/whats-new-in-laravel-5-3/episodes/15

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Film extends Model
{

    protected $table = 'film';
    protected $primaryKey = 'film_id'; 
    public    $timestamps = false;

    public function actors()

    {

        return $this->belongsToMany(Actor::class, 'film_actor');
    }



}
02 May
2 years ago

virgiltu left a reply on Trying To Get Property Of Non-object

Thank you guys, I really appreciate the help.

virgiltu started a new conversation Trying To Get Property Of Non-object

This has to be a really stupid question but here it is.

I have

        $category['id'] = 0;

I am trying to pull it with this

        return $category->id;

I know i can use $category['id'] but i need the above one so i do not have to reuse code.

virgiltu started a new conversation Global Variable Or Middleware

Maybe somebody can help me out so I dont have to rewrite a lot of code.

I need to pull my categories from the db so :: $categories = categories::all(); Into the header so i dont have call this every time in all my controllers.

Now my structure looks like this.

header.blade.php - header Items -----< Trying to bring data from $categories = categories::all(); home.blade.php - Home page has header @yeld product.blade.php - Product Page has header @yeld category.blade.php - Category Page has header @yeld

Thank you

virgiltu started a new conversation Bug Found.....

When creating an application, laravel keeps bringing up the cache file instead of the new file made.

Lets say that you make a user.blade.php and you change it, after some time laravel will not update the cache file. I honestly went as far a removing everything from the file and laravel kept open it like nothing was wrong. It keep rendering the files from storage>framework>views

I have been working on it for a few hours. I had to do a flush to get it to work again. Few hours later same issue.

16 Apr
2 years ago

virgiltu left a reply on Fatal Error: Call To A Member Function Save() On Integer

Thank you so much for the help.

15 Apr
2 years ago

virgiltu started a new conversation Fatal Error: Call To A Member Function Save() On Integer

Can somebody please tell me y this does not work.

 $product = products::whereSlug($slug)->firstOrFail();

   //Update Views 
     $product->increment('views')->save();

However this will work just fine

DB::table('products')->whereSlug($slug)->increment('views');

05 Apr
2 years ago

virgiltu started a new conversation Laravel As PHP Extension

Laravel is a great platform, but is there a reason this was not built like PhalconPHP as a PHP extension? I would only assume that it would skyrocket to the top of the Framework list for speed and friendliness. I like Phalcon a lot but the lack in documentation and videos just makes it really hard to understand how to get things done.

virgiltu started a new conversation Updating Expiration Date In The Database

Ok I know stupid title =).

I am creating a website that has many products for sale. I need the prices of every product to update based on when they were posted. For example I have a product posted today at 12:04PM. What I want, is for the application to change the price every day at 12:04PM.

I understand that a CRON will do that, however I am just trying to figure out if the server will take a toll trying to updated every price in the database.

My best guess will be to write the cron every minute and pull the products that match the time and then update them.

Will every minute be a huge issue? Or does anybody know of a better way? Also I am expecting to have a lot of products, i would say over 200k if not more.

Thank you

13 Feb
3 years ago

virgiltu started a new conversation Using Enum

Before I go ahead and build a new table, i figured i would ask for some help.

I have a field in MySQL table.

shipping    enum('Next Day', '2 - Days');

When I pull as set for my product I get "Next Day"

{{ $product->shipping }} 

What I am looking to get is the 0, 1, 2. ....... and so on.

Also what i cant figure out is how to get a list of all the enum items.

In a form I can do this but what i need is to be able to pull these values from the database. The only ideas is to create a relational database.

{{ Form::select('shipping', [  ''Next Day', '2 - Days'] ) }}
07 Feb
3 years ago

virgiltu left a reply on Blade Text Output

Never mind I guess i have to use an editor to get this done.

virgiltu started a new conversation Blade Text Output

Ok this is a stupid question. I know it but it is really irritating and I know i fixed it some time ago but now it is just not working.

I am adding a text area to my form and the data imputed is something like this.

Technical Specifications 802.11bgn (300Mbps) 2 LAN + 1 WAN + 1 USB Home Automation: ZigBee HA 1.2 Port Forwarding, Firewall, DMZ, UPnP Free iOS & Android Apps & Browser UI Range: 50-150 ft. (Depends on Construction) Power Supply: 12V, 1A (Input:110 - 220V, 50-60Hz)

However when i output it via {{ $product->specs }} or {!! $product->specs !!} i get this.

Technical Specifications 802.11bgn (300Mbps) 2 LAN + 1 WAN + 1 USB Home Automation: ZigBee HA 1.2 Port Forwarding, Firewall, DMZ, UPnP Free iOS & Android Apps & Browser UI Range: 50-150 ft. (Depends on Construction) Power Supply: 12V, 1A (Input:110 - 220V, 50-60Hz)

Any idea how to fix this.

04 Feb
3 years ago

virgiltu left a reply on Parsing Data, Helpers, To View

Excellent, i understand now.

virgiltu left a reply on Parsing Data, Helpers, To View

That is understandable, i have been trying to do exactly that as you can see in my code above where each price is passed through and generated as the days array. However the issue I am having at that point is that i can only generate it for one product and not 100 products that i need to display. And that is where I got stuck.

The view example above got me closer to what i was looking to do, however it seems that you can run any type of loops inside the helpers function as it will be run once for some reason.

I know there is a faster and much more scream line way to do this.

virgiltu left a reply on Parsing Data, Helpers, To View

Is it me or can we not run for loops in the helpers file. I even tryed this and all i got was one result.

for ($x = 0; $x <= 10; $x++) {
   $output = "The number is: $x <br>";
      return $output;
 }

The number is: 0

03 Feb
3 years ago

virgiltu left a reply on Parsing Data, Helpers, To View

Thank you so much that is what i was missing, i knew some stuff just not close enough. the MSPR was the price of the item.

virgiltu started a new conversation Parsing Data, Helpers, To View

This might be a nube question. Here is my scenario. Trust me i have spend hour on this with no good results. My Controller is pulling Products:all() from the database. One of the fields in the database is the MSRP price of the product. What i need to is pull drop the price for 10 days as you can see in the picture here. I was able to do it for one product, but i cant figure out how to do it for all the product in the result and than push it to the view. I know this is a mess but here is what i have so far. This is my controller right now public function index() {

    $products = products::all();
 $categories = categories::all();

  return view('homepage',compact('products','categories'));
}

This what i would like to do with every msrp value $msrp = $product[msrp]; $dayposted = "2016-1-26"; $cDate = Carbon::parse($dayposted); $today = $cDate->diffInDays(); $days = []; $i = 1; $percent = 0; for($n=0 ;$n<10; $n++) { setlocale(LC_MONETARY, 'en_US.UTF-8'); if ($i == $today) { $day = array_add(['day' => 'Day '.$i], 'price' , number_format( $msrp * ((100-($i10))/100),2, '.', '')); $day = array_add($day, 'class', 'today'); $price = number_format( $msrp * ((100-($i10))/100),2, '.', ''); } elseif($i == 10) { $day = array_add(['day' => 'Final'], 'price' , number_format( $msrp * ((100-($i10))/100),2, '.', '')); $day = array_add($day, 'class', ''); } else{ $day = array_add(['day' => 'Day '.$i], 'price' , number_format( $msrp * ((100-($i10))/100),2, '.', '')); $day = array_add($day, 'class', ''); } array_push ($days, $day); $i++; } This is my view @foreach ($products as $product) @foreach ($days as $day) @if ($day['class'] == 'today') Today ${{ $day['price'] }} @elseif ($day['class'] != 'today')

{{ $day['day'] }}${{ $day['price'] }} @endif @endforeach @endforeach And this is what i am trying to achive http://i.stack.imgur.com/YFbGT.jpg
06 Dec
3 years ago

virgiltu left a reply on Insert Array Of In Database

I found a solution using just PHP unfortunately Laravel does not have these built in, using the serialize() and unserialize() functions.

Thanks for the help.

virgiltu left a reply on Insert Array Of In Database

thank you,

i was trying to avoid having to request a new table every time i send this request, i am going to look if maybe comma delimited will be the way to go. having to create a new table and search through all of them again seems overkill when i can just swift through the data i already have requested. unfortunately i am paying per request on this projects server so this will add a lot of cost for an extra request in the long term. but thank you for your response, it i much appreciated it.

05 Dec
3 years ago

virgiltu started a new conversation Insert Array Of In Database

I have a table named videos->watched , i am trying to insert the auth user id as an array in this column.

the ides is simple the videos will be watched the controller will add to the array a new id, when the video gets updated the entire column gets dumped and it starts over.

Any ideas how i could insert the array? Sadly eloquent seems to think that $array is part of the query and I get an error.

Error: Call to a member function update() on integer Array: [{"0":"","user":1}]

Code: $array = array(array_add([$watched],'user' ,Auth::user()->id)); DB::table('videos')->whereId($id)->increment('views')- >update(['watched' => $array]);

12 Nov
4 years ago

virgiltu left a reply on New Installation Not Working.

Hi Kazi,

Here is my experience so far. I paid for the laracast videos. However, you will get stuck a lot. It all depends if you installed laravel 4 or laravel 5. To install laravel 5 you will need to install the from the -dev. In any case laravel 5 is much better and simpler in my opinion. However most of the videos you can not fallow. That is because they were made in an earlier version of the dev laravel 5. You have to find the latest videos in order to figure out how it works. And once you do that you will have to read the documentation. Dont get me wrong it is really fun. I hope this helps. O you will have to pay for laracast, because the laravel5 from scratch will not work on the latest released version. annotations is what is missing from the free videos.

07 Nov
4 years ago

virgiltu left a reply on Module Import In HomeController

So this is what I have so far but I still cant get it to work. I figured if I send the songscontroller to the homeview it will work but I dont think that it correct.

HomeController ''' /** * @Get("/") * */ public function index() {

  $module = 1;

return view('pages.home', compact('module')); } ''' HomeBlade

''' @section('content')

@if ($module == 1)

@foreach ($songs as $index => $song) 


 <li><a href="/cleardeals/public/songs/{{ $index }}">{{ $song }}</a></li>


 @endforeach

@elseif ($module == 2)

 @foreach ($products as $index => $product) 

<li><a href="/cleardeals/public/products/{{$index}}">{{ $product }}</a></li>


 @endforeach

@else

No Modules set

@endif

@stop '''

SongsController

''' /** * @Resource("songs") * */ class SongsController extends Controller {

/** * @return Resource * */ public function index() {

$songs = $this->getSongs();

return view('pages.home', compact('songs')); } ''' ProductsController

''' /** * Display a listing of the resource. * * @Resource("products") */ class ProductsController extends Controller {

/** * Display a listing of the resource. * * @return Response */ public function index() { $products = $this->getProducts();

return view('pages.home', compact('products'));

} '''

virgiltu started a new conversation Module Import In HomeController

I am new so sorry for the stupid questions.

I am trying to figure out how to bring some modules in the homeController like this.

I have Products, Songs, Books in my database. I am trying to create three modules that will show the latest added in the sql. I have that figured out already.

Now I want on my home page to get any of the three modules lets say based on when the variable module == 1 for Products or 2 for songs and so on.

I have pages created and views for all these. But I can not figure out how to bring these views in my home page based when that variable. What am i missing or doing wrong.

Is this done in the HomeController or in the View?

02 Nov
4 years ago

virgiltu left a reply on New Installation Not Working.

php artisan clear-compiled

virgiltu left a reply on Route Annotations Issue

Thank you so much!!!!!!!!!!!!!!!!!!!!!!! I have been at this for days.