distantplanet

Experience

7,825

0 Best Reply Awards

  • Member Since 3 Years Ago
  • 177 Lessons Completed
  • 10 Favorites

2nd December, 2017

distantplanet started a new conversation Creating A Schedule/calendar • 1 week ago

I need to create a calendar where user's can reserve time slots. The time slots cannot overlap.

Each time slot needs to be stored in a DB table or be linked to a DB table for an associated post.

There seems to be a lot of different ways to do this so i'm mostly seeking advice on the best way to go about this. Any recommendations of frameworks or libraries that would be best for this would be appreciated! Also any related tutorial would also be helpful.

Thanks!

27th November, 2017

distantplanet started a new conversation Do I Need One DB Table/Model Or Should They Be Seperate? • 2 weeks ago

I'm working on a website that consists of three main parts: An internet radio station, an (irl) events listing and an archive of recording from both the radio broadcasts and events.

These two components overlap in a lot of ways because some of the events are also broadcasted on the radio (but not all events are broadcasted and not all broadcasts are events)

Any of them have the option to be archived with audio recordings from the event or broadcast.

Radio broadcasts cannot overlaps as this is how DJs reserve time slot and see what times are available but Events can be at the same time as other events since they're often at different locations.

What i'm stuck on is whether it would be best to have one post type for both (with booleans such as isBroadcast and isEvent and all necessary fields for both types) or should i have separate DB tables and models for each.

Such as

Broadcasts: Title, date/time, description, image, audio_streaming_url, video_streming_url

Events: Title, date/time, description, image, venue, price

or just

Post: Title, date/time, description, image, isEvent, isBroadcast, streaming_url, video_streaming_url, venue, price

Having Broadcasts and Events the same as the Database table/Model seems easiest for the instances when the post is both a Broadcast and Event and also easier for Archiving because i could simply create archive post with post_id as a field.

Such as

Archive: Post_id, soundcloud_link, youtube_url, additional_text

But having a single post type would make it confusing in regards to reserving time slots for the radio broadcasts since the Events can overlap but the radio broadcasts cannot.

Or is this pointless to think too much about as i'm sure either way would work?

4th August, 2015

distantplanet started a new conversation Using Production DB In Local ENV • 2 years ago

I built a site locally with some dummy data and pushed it to production. there's still some work to be done but since i have people adding content to it now, it'd be nice to access that DB when i 'm working locally.

I entered the credentials to my production DB in the .env file but it won't connect. what am i missing?

thanks

distantplanet started a new conversation Formating Textfield • 2 years ago

I have a form with a textfield that saves into my db and i want to display that text on the website.

what is the best way to format the text? is there a good library for this? mainly line breaks but other styling options (like a blog style post) would be nice too.

1st August, 2015

distantplanet left a reply on [UPDATED] Multiple Jplayers From Laravel DB • 2 years ago

UPDATED. Is there any way to mark this unanswered?

distantplanet left a reply on Form Binding For Select Input (not Working For Edit) • 2 years ago

well that works! thanks so much @bobbybouwmann !

distantplanet left a reply on Form Binding For Select Input • 2 years ago

still stuck :/

distantplanet left a reply on Creating Multiple Jplayers From Laravel DB • 2 years ago

I thought i had it but it's loading the same audio file for each player...also i have trouble when i navigate deeper into the website. ex: with mydomain.com/segments/ the audio player adds segments to the url instead of just the public directory. I know a similar issue can be solved with the URL:asset, but i'm not sure how to with this since it's the jquerry that's getting the file.

Sorry i know this is not entirely Laravel but it's where the jQuerry and Laravel overlap that's really confusing me!

Home page View

<div id="latest">
        <!--  {{ $count = 2}} -->
    @foreach ($archives as $archive)
            <div class="singleLatest">
                <p>{{{$count}}}</p>
                <img src = "/images/segments/{{$archive->segment->image}}" width="100px;"/>
                <div class="playerAndInfo">
                    <h3> {{ $archive->archiveTitle}}<br>{{$archive->segment->name}}<br>{{ $archive->dateAired}}   </h3>
                    <div id="jquery_jplayer_{{$count}}" class="jp-jplayer"></div>
                    <div id="jp_container_{{$count}}" class="jp-audio" role="application" aria-label="media player">
                    <div class="jp-type-single">
                    <div class="jp-gui jp-interface">
                    <div class="jp-controls">
                        <button class="jp-play" role="button" tabindex="0">play</button>
                    </div>
                    <div class="jp-progress">
                        <div class="jp-seek-bar">
                            <div class="jp-play-bar"></div>
                        </div>
                    </div>

                    <div class="jp-time-holder">
                        <div class="jp-current-time" role="timer" aria-label="time">&nbsp;</div>
                        <div class="jp-duration" role="timer" aria-label="duration">&nbsp;</div>
                    </div>

                    <div class="jp-no-solution">
                        <span>Update Required</span>
                    To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
                    </div>
                    </div>
                    </div>
                    </div>
                </div><!--end playerAndInfo-->
            </div> <!-- end single latest -->

   <!--  {{ $count = $count +1}} -->
        @endforeach

</div><!-- End latest -->

Creating Jplayers from DB


    <!--{{{$counter = 2}}}-->
        @foreach ($archives as $archive)

            <script>
            var counter = "{{$counter}}";
            var file = "archiveAudio/{{{$archive->audioFile}}}";

        $(document).ready(function(){
        $("#jquery_jplayer_"+ counter).jPlayer({
            ready: function () {
                $(this).jPlayer("setMedia", {
                    title: "Hidden",
                    mp3: file,
                    oga: ""
                });
            },
            play: function() { // To avoid multiple jPlayers playing together.
                $(this).jPlayer("pauseOthers");
            },
            swfPath: "../../js",
            supplied: "mp3, oga",
            cssSelectorAncestor: "#jp_container_" + counter,
            wmode: "window",
            globalVolume: true,
            useStateClassSkin: true,
            autoBlur: false,
            smoothPlayBar: true,
            keyEnabled: true
        });
       counter ++;

        });


            </script>

        @endforeach


31st July, 2015

distantplanet left a reply on Creating Multiple Jplayers From Laravel DB • 2 years ago

thanks got it!

distantplanet started a new conversation Form Binding For Select Input • 2 years ago

I have a form for creating a new "segment" with a Select option for "city" that is being populated with a foreach loop from my db.
(eloquent relationship is set up -- segment belongs to city / city has many segments)

it all works fine except when i edit the "segment" the form-binding is not populating the select input. though it's working with my text inputs.

I'm using the form facade for my other inputs but couldn't figure out how to include my for loop in it so i've used the html select. I've been searching hard for this and can't seem to find a solution for my situation.

edit.blade.php ''' {!! Form::model($segment, ['method' => 'PATCH', 'files' => true, 'action' => ['SegmentsController@update', $segment->id]]) !!} @include ('segments.form', [ 'submitButtonText' => "Edit Segment"])

{!! Form::close() !!} '''

form.blade.php '''

{!! Form::label('city', 'City:') !!}
Select A City @foreach ($cities as $city) id}}"> {{$city->name}} @endforeach '''

segmentsController.blade.php ''' public function edit ($id) { $segment = Segment::findOrFail($id); $cities = City::latest('id')->get();

   return view('segments.edit', compact('segment','cities'));

} '''

thanks!

28th July, 2015

distantplanet started a new conversation Creating Multiple Jplayers From Laravel DB • 2 years ago

This Jquery Code sets the media for a new instance of a jPlayer. Is it possible to put a laravel foreach loop around it like this to set multiple instances of the player from a laravel DB?

I'm adding the count to the jplayer instance ID and and setting the mp3 to a file in my database but they brackets throw of the jquerry. is there a way to escape them or am i going about this the wrong way?

@foreach ($archives as $archive)
$count = 2

$(document).ready(function(){
        $("#jquery_jplayer_{{$count}").jPlayer({
            ready: function () {
                $(this).jPlayer("setMedia", {
                    autoPlay: true,
                    title: "Live Stream",
                    mp3: "archives/{{archive->audioFile}}"
                }).jPlayer("play");
            },
            play: function() { // To avoid multiple jPlayers playing together.
                $(this).jPlayer("pauseOthers");
            },
            swfPath: "../../js",
            supplied: "mp3, oga",
            wmode: "window",
            globalVolume: true,
            useStateClassSkin: true,
            autoBlur: false,
            smoothPlayBar: true,
            keyEnabled: true
        });

Thanks!

27th July, 2015

distantplanet started a new conversation Admin Customizable Background IMG • 2 years ago

what's the basic approach for having a admin customizable background image?

i have a form set up to upload a new background image and save the name to a db.

now i'm wondering where i connect the database call for the image name to the CSS so it works on every page.

21st July, 2015

distantplanet left a reply on Index Of / (phpinfo.php Only File Listed) - Laravel 5/Forge/Digital Ocean • 2 years ago

Thanks! that pointed me in the right direction, definitely a DNS issue...

20th July, 2015

distantplanet left a reply on Index Of / Page (phpinfo.php Only File Listed) - Laravel 5/Forge/Digital Ocean • 2 years ago

it's worked intermittently. after only seeing the index of / page for a few hours it started showing my page again for a couple minutes but with some issues with images not loading (when i refresh a couple times the show up)

distantplanet started a new conversation Laravel 5 / Forge / Digital Ocean -- My Sites Not Showing Up • 2 years ago

I've been trying to deploy a Laravel 5 site with Forge and Digital Ocean and have been running into some difficulties

i keep getting a page that says

Index of / and the only file listed is phpinfo.php

so it seems like it's not finding my index.php file but the thing that's stumping me is the site works fine intermittently (everything was working for about 5 minutes and then i tried again without changing anything and it was back to the index of / page.

also, when i ssh into digital ocean server all of the files are there and i'm also able to connect to the database with sequalPro so it seems like it's deploying ok?

any help would be appreciated, thanks!

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.